In a town where lying is art form, Paul Feig is a fervent believer in honesty.

That’s why there are more than 180 times in which some form of the word “fuck” is used his upcoming action comedy “The Heat,” mostly by Melissa McCarthy’s detective character. For his part, Feig is unapologetic.

“Comedy is only really funny when it feels honest,” he says. “So that’s the way people talk these days — people don’t hold back language-wise.”

Feig’s faith in truth — comedic or emotional — has been a guidepost in his evolution from standup to writer-director in TV and then film.

In “The Heat” (opening June 28), McCarthy’s foul-mouthed cop is matched with Sandra Bullock’s uptight FBI agent.

“At our test screenings, people would say ‘It’s such a sweet movie,’ despite the language, and I think that’s because it’s so organic to her character,” he says. “It’s not done in this ugly way where she’s attacking people — that’s just the way she talks.”

“The Heat” is opening two years after Feig and McCarthy scored a smash hit with “Bridesmaids” — another R-rated comedy.

“We didn’t really know until the end whether ‘Bridesmaids’ was going to be R rated or PG-13,” Feig recalls. “I make sure to shoot PG-13 versions of each scene, but from the first test screening on, people liked the R version so much that we never tried to clean it up. The honesty felt real.”

Feig remains genuinely perplexed as to why Hollywood hasn’t been rushing to make more comedies like “Bridesmaids.” A day after a well-received screening of “The Heat” at CinemaCon in April, he expressed frustration over studios citing the lack of female stars for the international market as a reason for not backing female-driven projects.

“I’m desperate to change that,” he said at the time. “I would love to figure it out.”

To that end, Feig signed a three-year first-look deal with Fox earlier this year and is developing a female comedy-action project.

“They like it, and we’re just trying to figure out casting and how soon we can go. I’ve said on the red carpet that it’s a female James Bond action comedy. I’ve always loved action comedies like ’48 Hours’ and wanted to dabble in that world. And I’m also a James Bond fanatic, so I figured I’d write my own.”

Feig’s comedy roots are in standup, dating back more than four decades.

“I started when I was 7, and we were singing ‘Yellow Bird’ and I started doing a stupid dance,” he recalls. “My classmates told me that Miss Hill was crying, she was laughing so hard.”

By the time he was 15, his parents were taking him to perform comedy at the Delta Lady in Detroit with Dave Coulier and Mike Binder. He moved out to L.A. in the early 1980s, started working for producer Michael Phillips, won $29,000 on “The $25,000 Pyramid” and began performing standup full time, crossing paths with Judd Apatow and Andy Kindler.

“Standup teaches you everything in comedy,” he recalls. “There are moments when I miss standup because it’s such a pure art form. It’s funny with the test-screening process for both Judd and I because that’s the way that we used to work our acts — you have a bunch material and you do it and then you decide what worked.”

Feig used nearly a dozen test screenings for both “Bridesmaids” and “The Heat.”

“I start them two or three weeks into my director’s cut and then every two weeks we’ll do another,” he explains. “Because it allows me not to fall in love with my edit. If you start early, you have no emotional investment in the cut.”

Feig admits he’s amazed at how 500 or 600 people can be a pretty good predictor for how the movie will play, saying that “it’s kind of like when you’re watching an election and 0.5% of the precincts have reported so they are reporting the winner.”

Feig admits that he’s still surprised over his success with “Bridesmaids,” which came four years after kid comedy “Unaccompanied Minors” and a dozen years after creating TV cult favorite “Freaks and Geeks.”

“After ‘Freaks and Geeks,’ I got sent lots of comedy scripts, but they were always for guys trying to get laid,” Feig says. “And I just never responded to that kind of guy. When I tried to write something in that world, I always felt like an imposter.”

He was working extensively in TV, directing episodes of shows such as “The Office,” “Arrested Development,” “30 Rock” and “Mad Men” when he made his feature debut with “Unaccompanied Minors.”

“It really put me in movie jail pretty hard,” he recalls. “I kind of wanted to do a John Hughes meets John Landis kind of thing with it.”

Instead, Warner Bros. decided in early production to play down the element of divorced parents, which removed the extra layer of an emotional core, as Feig saw it.

“It kind of turned into a fun romp, but it wasn’t what my audience from ‘Freaks and Geeks’ was expecting — and the critics were expecting a little bit more out of me, so it was a shock to the system,” he says. “I was proud of it. It worked like gangbusters in front of an audience of kids — which is all I was shooting for.”

Three years later, he was directing “Bridesmaids” for Apatow from a script that Kristen Wiig and Annie Mumolo began developing in 2005.

“I had read ‘Bridesmaids’ back in 2007 and got so excited,” he recalls. “I thought there all these great roles for women, and there are so many women I’ve worked with who would be fun to cast. It was a little terrifying when I was on it because you had the feeling that everyone was looking at it like, ‘OK, let’s see if ladies can carry a movie,’ which is kind of ridiculous.”

He also carried the lessons of “Unaccompanied Minors,” which hadn’t performed well at the due to a lack of spectacle.

“So the lesson that applies to Bridesmaids was there was something special to pull you in,” he says. “It was a women’s movie that you hadn’t seen before. It was R rated and kind of bawdy and we had big set pieces like the dress-shop scene. I’ve never heard women in an audience laugh like that, where it’s just like screams of laughter.”

Now it’s on to a female James Bond comedy, which began percolating five years ago when “Casino Royale” opened.

“That’s one of my favorite movies of all time,” Feig recalls. “It was almost a religious experience because Daniel Craig is so great — he’s a dark brooding character, the action is real. The opening scene is like the greatest ever and it kind of rekindled my enthusiasm to do action comedies. You want to give people a little bit of spectacle, even if it’s comedic spectacle.”