Started with a follow-up to fa9b2f97, which missed applying the fix to docs, and then added some more while reading it.
fa9b2f97
It is only used in a single place to check for Python 2, which can easily be inlined.