If it weren't for the oddness of the language, Lua would be a perfect fit. Near-C speeds, super flexible, no recompiles.
You'd lose type safety compared to Rust, but they don't have that with JS now anyway.
I don't think the majority of the memory consumption is from JS though, moreso the embedded browser+DOM approach.
Edit: Blaming electron for bloat more than JS.