The Royal Navy has had fighter pilots with beards, wearing oxygen masks in fighter cockpits, since WW2 to my certain knowledge. I've never heard of it causing a safety hazard.
Personally I think that some 2000+ years after the razor was invented, a smooth chin remains smart and preferable, and I have no desire to ever grow this sort of face fungus. But, that's a matter of personal aesthetic - I know of no sound safety reason a pilot needs to be cleanshaven.
Knowing all of the onboard systems, and having proper trimming discipline on the other hand - essential.
G