Safety razor was invented around WWII [0] and that is probably linked to the requirements of wearing a gas mask. Probably has something to do with the change in fashion.
Fun fact; often there is a general ban on beards in underground coal mines because the miners need to be able to wear gas masks.
It's the same way in chemical plants that handle H2S or other dangerous chemicals. I've always had a beard, but I'd have to shave it when installing or servicing our equipment in those plants.
I mean in between the renaissance and WWII the fashion has changed a lot.
They declined during the early modern period, took off after 1850, went out of fashion in the early 20th century, were common place in the 60's and 70's, and declined again until the recent revival this century.
Fun fact; often there is a general ban on beards in underground coal mines because the miners need to be able to wear gas masks.
[0] https://en.wikipedia.org/wiki/Razor#History