This is not an issue with Rust the language but with the standard library which assumes allocation is not a big deal.
Traditional where allocations matters, like for embedded devices you would use no-std.
An alternative standard library with a different focus is entirely possible.
Or as a middle ground a lint flagging allocations.
As an aside I believe the last ‘expect’ issue to triggers an existing clippy lint.