With great power comes great responsibility, I guess. I agree it would have been nice for Linux to come with a few more sanity checks by default, like maybe a warning flag for rm -rf /* and dd commands...
--no-preserve-root
do not treat '/' specially
--preserve-root
do not remove '/' (default)
https://manpages.debian.org/stretch/coreutils/rm.1.en.htmlMind that if your rm comes from elsewhere (say, Busybox), it may not have that protection.
Very careful use of rm as root is an excellent habit to cultivate.
As are backups.
If you can't properly start the OS, that's correct behavior. You don't want the OS to start writing things to /var when it can't mount the filesystem that should be mounted to /var.
In any case, the fix with an RPi is easy - pop out the microSD, mount it on the other computer and fix whatever is broken (which should be in the logs). If the RPi is the only computer, put a microSD with a plain install of the OS, mount the other microSD through an USB dongle and fix it the same way you'd do with a laptop.