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.