You don&#x27;t <i>need</i> to actually convert anything: Python 2&#x27;s str can be identified with Python 3&#x27;s bytes, and unicode with str.  You &#x27;just&#x27; need to have their __getattribute__ methods, along with a ton of standard library functions, check the Python version of the caller and change behavior accordingly.  Ugly, but I think it would mostly &#x27;just work&#x27; for user code.