With the adoption of Python 3 in Sage, we have access to a lot of more recent development in python. One of which is the new "import" machinery, which makes hooking in particular processors a lot easier. For some examples:
I'm not suggesting that we should adopt one of these to implement our preprocessor, but I think some of the ideas in there could help with a cleaner implementation. Obviously, sage's REPL doesn't put its code through import hooks, but appropriate modularisation of the process would probably make it relatively straightforward to implement an IPython REPL that uses similar steps (it still needs to tokenize, parse, transform ASTs, and compile)
I don't have concrete ideas for, or experience with, rewriting the preparser. I'm just flagging the opportunity in case there is someone with the right skill set who would find this a fun project. It would require some experimentation to get right, but if it works correctly (and more efficiently?) I think there will be appetite for adopting it.