You cannot make a safe yet universal cutting tool.
I’m neither language designer or crustacean advocate, but from what can be read, Rust seems to have managed just fine. The trick is probably to allow removing the cover of the sharp edge when needed (execute unsafe).
Late to the party, but a serious suggestion; give uv for Python dev env/package management and ruff (or Black, for that matter, if you’re not using a formatter yet like some others here in the comments) for linting/formatting a shot.
They’re great and feel magical to use if you’ve known the
painexperience of not having them.