It it is unsafe to code, full stop.
The things we're expecting our code to handle, with the lack of formal verification testing we're expecting our code to ship with, there's no such thing as safe. It took 50 years to "build the stack" to where we're at, and we did it fast and cheap. There's so many bugs hiding in the lasagna it's amazing it doesn't eat itself.
If you re-build your system from first principles, open source silicon with peer review and constant scrutiny, then the BIOS, then the OS, then the application compilers, and the libraries, all open AND reviewed by multiple concerned parties with formal demonstration of correctness all the way up - the entrenched bug filled lasagna stack owners will smother you, they can't withstand that kind of competition on an open playing field, your project will die of financial starvation, regulation, buyouts and treachery.