I used RustPython to create this proof of concept, more specifically, this fork that trims away wasm_bindgen which is not supported in NEAR environments since NEAR environment is not a browser environment. Here is how to compile it:
cargo build --target wasm32-unknown-unknown --release
NEAR mainnet and testnet has a limit of 4.1MB for the contract size and transaction size, but the resulting binary I got is 9.1MB, so I tried to strip it:
wasm-opt -Oz --strip --vacuum target/wasm32-unknown-unknown/release/pycontract.wasm -o pycontract.wasm
I still get 4.3MB Wasm, which is not enough to push it through. Next steps are:
__wbindgen_*
imports (see WAT output to see that the current contract tries to import those host methods that are not available, so it won't get executed in NEAR)