Maybe there's merit in a Python version that compiles to JS where we allow engines like V8 to do the optimisation. The dynamic nature of JS maybe enough impedance-MATCH to allow this to happen?
Writing this up, I'll probably get someone suggesting that this is already a reality with some tool. Glad to be taught.