That was the first of the “Guiding Principles for Motion Picture and Television Treatment of Homosexuality” released in 1973 by activists fed up with Hollywood’s habit of playing gay people for laughs. “Sometimes anything can be a source of humor,” the statement continued, “but the lives of 20 million Americans are not a joke.”

Except when they are. Josh Collins, the director of the new film “Fags in the Fast Lane,” an Australian gaysploitation comedy in the spirit of sci-fi sex spoofs like “Flesh Gordon,” wants the gay community to stop taking itself so seriously.

“Comedy must be irreverent or it wouldn’t be funny,” Mr. Collins said. “Nobody wants to watch model gay fare all the time.”

Since the silent era, gay culture and gay men in particular have been laughed at on screen. Too often the jokes had cruel roots. As the gay film historian Vito Russo noted in his landmark book, “The Celluloid Closet,” “The history of the portrayal of lesbians and gay men in mainstream cinema is politically indefensible and aesthetically revolting.” Pansy, killer, nympho, coward: film comedy is littered with ugly and painful stereotypes that emasculated, infantilized and diabolized gay men.

“It was so easy to code certain people as gay,” the film historian David Del Valle said in an interview. “All it took was a limp wrist and a lisp.” (Lesbian, bisexual and transgender characters have been less visible on screen, and when they have appeared it wasn’t pretty either.)

It’s no wonder that gay activists spent decades pushing back against Hollywood stereotypes. But can gay characters be both offensive and funny? It’s a yes from gaysploitation, a subgenre, rooted in the sex-crazed work of Russ Meyer and Doris Wishman, that overflows with stereotypes behaving badly, like mincing villains and killer drag queens.

To understand how gaysploitation upended clichés, it’s worth knowing why people were laughing in the first place. Here’s a look at how, through an uneasy mix of insult and pride, gay male characters have evolved in big-screen comedies.

The Nance

Image

Franklin Pangborn, with Adolphe Menjou, left, and Gail Patrick, in another film from the 1930s, “Stage Door.”CreditWarner Bros.

In the 1930s and ’40s, “a movie projector was as a lighthouse for gay men and women,” Richard Barrios wrote in his book “Screened Out: Playing Gay in Hollywood From Edison to Stonewall.” For many gay men, watching nelly store clerks and fastidious bank examiners, played by actors like Edward Everett Horton and Grady Sutton, was the only way to see themselves represented on screen. Nobody played the pansy better than Franklin Pangborn, who with his pursed lips and precision double takes could be a proto-Jack McFarland. In films like the screwball comedy “Easy Living” (1937), Pangborn’s expert comedic chops “won hearts,” according to Russo, despite — or thanks to — being in service of stereotypes.

The Gal Pal

Image

David Wayne, center, with Spencer Tracy and Katharine Hepburn in “Adam’s Rib.”CreditMGM

Comedies of the late ’40s and ’50s finessed the nance into more of a coded gay best friend who often served as the smart alecky foil to the straight leading man. Much to the chagrin of Spencer Tracy in “Adam’s Rib” (1949), David Wayne was “a high-class Ethel Mertz” to Katharine Hepburn’s “feminist Lucy Ricardo,” as Russo put it. This gay character — usually single, smart and just a little sad — lived on in “Only When I Laugh” (1981), with James Coco as Marsha Mason’s gay bestie, and “Victor/Victoria” (1982), with Robert Preston as Julie Andrews’s drag-loving confidant.

The Rebel

Image

Divine in the John Waters film “Female Trouble.”CreditDreamland

While activists in the ’60s battled the pernicious misconception that gay men were depraved perverts, John Waters fell in love with it. In “Multiple Maniacs” (1970) and “Female Trouble” (1974), Mr. Waters enlisted his clown-alien drag muse Divine to shock audiences with subversive story lines that — to the outrage of the growing gay rights movement — helped gaysploitation emerge in the post-Stonewall, sleaze-crazed ’70s. His films made his native Baltimore look like the queerest place on the planet. They “created this phantasmagoria of a landscape of America that was more real than people realized,” Mr. Del Valle said.

The Men in Wigs

Screen drag has a problematic past, raising questions about sexism, sexual identity and ownership of gay culture. (It’s complicated.) Since the silent era, with overt depictions of gay men verboten, drag was often just a comedic device straight men used to get away with something. Fatty Arbuckle donned sausage curls to avoid his wife in “Coney Island” (1917). Jack Lemmon and Tony Curtis became filmdom’s most famous cross-dressing duo as straight guys evading mobsters in “Some Like It Hot” (1959). Dustin Hoffman needed a job in “Tootsie” (1982). A gay trailblazer was the French-language comedy “La Cage Aux Folles” (1979) about an actual drag queen (with a partner!). Fast forward, and the “RuPaul’s Drag Race” winner Bianca Del Rio has starred in her own film, “Hurricane Bianca” (2016), a revenge comedy about a gay man who uses drag to play straight and fight injustice. It’s worth noting that this category is particularly racially diverse, from Wesley Snipes and John Leguizamo in “To Wong Foo, Thanks for Everything! Julie Newmar” (1996), the still-rare Hollywood film to feature drag queens as leads, and Chiwetel Ejiofor as a working-class queen in “Kinky Boots” (2005).

The Neo-Revolutionary

“Fags in the Fast Lane” is a return to the transgressive, low-budget films under the gaysploitation umbrella that directors like Curt McDowell and Bruce LaBruce unleashed in underground circles decades ago. As for offensive-funny characters, take your pick: the Bollywood eunuch assassin or “Aztec she-male worshipers,” as the trailer puts it. For inspiration, Mr. Collins cited three comedies that once were on gay activists’ hit lists: “The Pink Angels” (1971) about gay bikers; “Zorro, the Gay Blade” (1981), the swishbuckling adventure film (with a gay character named Bunny Wigglesworth) and “The Gay Deceivers” (1969), about straight guys who pretend to be gay to dodge the draft.