I'm not sure how I'll pack my razor next time (the time I cut myself was the last time I traveled) but I'll have to change how I do things going forward. Maybe I'll put the whole thing into one of those plastic clamshell soap containers, although that would be a bit bulky.
One subtle problem I've noticed with shaving in the shower is whisker splinters. Twice (both times during the pandemic, after not shaving for two or three weeks) I've gotten a whisker embedded into the bottom of my foot and didn't figure out what the strange pain was until a few hours later when it worked itself in deep enough that I couldn't ignore it anymore. I think this only happens if I've let my hair grow too long, so now I avoid this.