You need to think of sex and gender like signs and symptoms. For example, a symptom of tonsillitis is a sore throat, a sign is inflamed tonsils. Sex is biological, gender is societal.
If we want to look at masculinity in comedies, let's compare Hugh Grant in Notting Hill and Bridget Jones's Diary. In Notting Hill, he played a bumbling bookstore owner who won the heart of a famous actress. While, if you went to the movies with prescription goggles because you couldn't find your glasses, you'd get a few weird looks, I would rather have a bumbling bookstore owner (provided they didn't make racist comments) than a lecherous character. Okay, Hugh Grant wanted to challenge himself to play a non-bumbling character, but I would rather be typecast as a bumbling person than a lecher, if I was an actor.
What we need to do is move towards a more egalitarian society.