'The Heat' gleefully plays with the buddy cop genre

In person, Bullock was the alpha female, McCarthy more reserved — in stark contrast to the naughty, all-id characters she often plays.

PHOTOS: Hollywood backlot moments

One thing both women share is a willingness to wield their bodies on-screen in unflattering ways: In "The Heat," Bullock is all angles — elbows and knees and pin-straight hair, and McCarthy is a lady linebacker, barreling after criminals in MC Hammer pants.

"It's those weird quirks to me that make someone who they are," McCarthy said. "A lot of times, especially for women, all of the tools are taken away. You have to look perfect, act perfect, you're perfectly poised, you're always appropriate. I don't know anyone who's like that, but also you've taken away all the tools to be funny or to be odd."

In one scene, Ashburn and Mullins drunkenly dance in a bar — Feig provided a choreographer on the set, but the actresses dismissed the idea, fearing the dance would not be sufficiently awful.

"We have to be the butt of the joke," McCarthy said. "If you're outside commenting or winking ... no, you're the ass. You are the joke. You have to take the hit. The more you can take the hit, the funnier it is for people watching … just out of sheer relief that, 'I'm not the one who ripped her pants.'"

The bar dance scene in "The Heat" was inspired by moments in screenwriter Dippold's own 20s and by a montage in the 1986 buddy cop comedy "Running Scared" when actors Billy Crystal and Gregory Hines were living it up in Key West and the camera kept cutting to them on scooters with a different woman on the back. Dippold wondered, was there a screen version of that kind of fun for women?

"Growing up in high school, it felt like the guys dictated where the party was," said Dippold, 33, who performed with the New York-based improv comedy group Upright Citizens Brigade before moving to L.A. for a writing job on the sketch comedy show "MADtv." "Girls would be like, 'This is where all the guys are. What a fun thing!' But I like when I'm out with female friends and it's just a crazy time."

PHOTOS: Celebrity portraits by The Times

When it comes to the box office, "The Heat" is in heavy male company, coming out in the hyper-masculine season of movies such as "Man of Steel" and "The Lone Ranger." The film was originally scheduled to be released in the spring, but 20th Century Fox shifted it to June 28, in part because the summer had little to offer women but also because "The Heat" tested so well, according to Feig.

"We were completely four-quad," Feig said, referring to the four demographic groups as measured by movie studios — men and women over and under age 25. "I made sure we didn't tilt too much either way. The lady jokes I like are like the Spanx. It's relatable to women, and yet guys can find it kind of funny."