It’s lucky that directors Peter and Bobby Farrelly don’t need a federal grant to make movies. Given the latest Supreme Court ruling requiring decency in the funded arts, the Farrelly brothers wouldn’t get a dime for There’s Something About Mary, an indecently funny sex farce with something to offend every special-interest group. “Is that hair gel?” asks the sweetly innocent Mary (Cameron Diaz), mistaking the wad of semen dripping from the ear of Ted (Ben Stiller) for a grooming aid. She rubs the stuff into her hair, causing it to stick up like a congealed monument. I won’t snitch about how Ted managed to jerk off onto his own ear, but when I saw the movie, the soon-to-be-infamous semen — a hard-core staple making its debut in a mainstream Hollywood comedy — prompted a freaked-out segment of the audience to sprint for the exits.

Good riddance. There’s Something About Mary is sensational, sicko fun — you won’t believe your eyes — and just the thing to shake up the creeping conservatism that is draining the vulgar life out of pop culture. Seinfeld is castigated for ethnic slurs. A Chinese opera (The Peony Pavilion) is labeled pornographic. Catholics protest a yet-unstaged play about a gay Jesus — Terrence McNally’s Corpus Christi — while Jews object to a Superman comic that tackles genocide without mentioning Jews by name. Handicaps are taboo for teasing. Classic screen grossouts, such as the “Springtime for Hitler” number in Mel Brooks’ The Producers or the crucifixion song in Monty Python’s Life of Brian, seem unthinkable now. Our only fear is fear of giving offense.

Cheer up. The Farrelly brothers don’t scare easy. Not only do these siblings from Rhode Island — where Mary is set — give offense to the PC police, but they revel in doing so. Admittedly, I didn’t discern the method in the Farrelly madness on the basis of their first two films. The crowd-pleasing Dumb and Dumber, for all the prankish clowning of Jim Carrey and Jeff Daniels, rarely extended its humor beyond the toilet. And Kingpin, despite Bill Murray’s inspired shots at bowling, left an acrid aftertaste.

There’s Something About Mary, which offers the biggest and boldest laughs around this summer, stays consistently entertaining by consistently ridiculing sacred cows. This flick does not shoot its wad with a joke about jism. Laughs are elicited at the expense of race, sexuality and economic status. Words such as cripple and retard are used with equanimity. A man in leg braces is an object of mocking humor, while stalkers, serial killers and shoe fetishists are presented with a sneaking sympathy.

Diaz, the babe supreme, plays Mary with the beaming sexiness and sharp comic timing of a born star. She soars above the gross depravity. A former model who showed acting chops in The Mask and My Best Friend’s Wedding, Diaz, 25, is a subject the camera loves.

The quest to win Mary sparks the script, which the Farrelly brothers co-wrote with Ed Decter and John J. Strauss. Ted has been obsessed with Mary since high school, when, despite his nerd status, she invited him to the prom. Sadly, Ted never made it out of Mary’s bathroom, where he managed to get his dick and balls caught in the zipper of his prom suit. Mary’s mom (Markie Post), her black stepdad (Keith David) and her mentally challenged brother (W. Earl Brown) are horrified at the sight. A fireman frees Ted’s package with one swift yank (“We’ve got a bleeder!”).

Years later, Ted can’t forget the incident — or Mary, who has long since left Rhode Island. Ted’s best bud, Dom (the invaluable Chris Elliott), hooks Ted up with private eye Pat (Matt Dillon). Pat traces Mary to Florida, where she’s working in orthopedics, caring for her handicapped brother, dating a disabled architect (Lee Evans) and living with Magda (Lin Shaye), a man-eater with a melanoma tan and a dog she dotes on. The dog scene, in which Pat thinks he has killed the mutt and then tries to revive it with a jolt from a lamp wire, manages to be a new low in perversity and a roaring hoot.

There’s a wicked twist in everything from the wry songs of Jonathan Richman to the fearless performances. Stiller nails every laugh in playing a romanticized version of a stalker. And Dillon, sporting huge yellow teeth, is hilariously sleazy as the detective who falls for Mary and hustles to eliminate his rivals, who include a pizza boy, football star Brett Favre (don’t ask) and a married man who wants to sniff Mary’s shoes.

The Farrellys, who co-wrote two episodes of Seinfeld, are hunting bigger game than a cheap wallow in sexual perversity. Not that there’s anything wrong with that. Their goal is the liberation of comedy from the chains of timidity, banality and censorship. There’s Something About Mary recalls a time when slipping on a banana peel was something to guffaw at without guilt: Shock comedy, the cathartic kind that snaps us into an awareness of cultural hypocrisy, is thriving in the deviant hearts of the Farrelly brothers. And, boy, do we need it now.