Could you compile Python to Web Webassembly instead of JavaScript? Presumably that would have better performance.
AFAIK the ideal way to maximize the performance of Python in the browser would be to JIT-compile Python code to WebAssembly. Does anyone know whether WebAssembly implementations are able to support that?