Macro if-python2 for compile-time choice between Python 2 and Python 3 code branches

See my in-line comments in #269 for a motivation. We should never test the Python version at runtime for such things.