How does Python-in-WASM work around that? For example, how does `for line in sys.stdin:` work if you can't actually block on stdin?
Emscripten has some support for this via the "asyncify" transform, which layers additional control flow to enable return all the way up the call stack, and then "rewind" back down into it. But this bloats the code (and is also buggy) so maybe it's not being used.