Silly question I know but can you have a career as a physicist and be a guy with longer hair?
Nope. Most physics experiments involve high speed turbines which will chop your beard (and head) clean off. Even theoretical physicists can't have beards because then people confuse them for raving psychotics when they start talking about string theory.
Having a job and having long hair and a beard are one thing. Once you're hired, they look more at your performance than your hair/beard.
Getting a job when you have long hair and a beard is a different thing. Since they don't really know what your job performance is like, they rely on shallower things.
But it is statistically true that the average hair length of people with careers in physics is shorter than the average hair length as a whole. In fact, that could be the reason more men have careers in physics than women - it's the hair that does it!
I'm a physicist and I had long hair (past my nipples) until recently. I also shave like once a month because I hate shaving. No one I work with seemed to care. The only people who complained were my girlfriend's parents, who said I looked homeless.