‘I’m 46 years old,” says Kathryn Hahn, curled up on a seat opposite me. “And I still have no idea who I am.” For a while, Hollywood wasn’t sure either. She was the supportive romcom friend in How to Lose a Guy in 10 Days, the sex-crazed wife in Step Brothers and the dutiful mum in The Visit, stealing scenes whenever she could – but always playing a woman defined by someone else.

“I was burning for bigger opportunities,” she says, in a meeting room in HBO’s new Manhattan office. “But I never thought they would happen. I never thought I would be seen as the lead. I always felt like an outsider.”

Having scored the lead role in HBO’s riotous new comedy series, Mrs Fletcher, it’s clear that Hahn is firmly on the inside. But even now, she’s keen to keep herself firmly grounded. “I don’t usually dress like this for an interview,” she says, explaining that her pristine, all-white get-up is for an on stage panel appearance she’s heading to next. “No offence,” she adds. “I’m usually a sweatpants kind of gal.” She’s eager to take off her shoes but asks first, worrying it might seem “tacky”.

Mrs Fletcher, based on the book by Tom Perrotta, is a dual coming of age story: high-school jock Brendan is dealing with the horror of life as a nobody at college, while his divorced mother Hahn is grappling with an empty nest. “I responded to her sense of hunger,” says Hahn. “That overwhelming sense of existential loneliness for this woman who had given so much of herself. She tried to play by the rules, did everything she was asked, tried to be the good girl her whole life. Then finally she was left with ‘What now?’”

The answer is an explosive sexual reawakening fuelled by an increasing obsession with pornography. “It’s this Pandora’s box,” says Hahn. “Once she starts to dive in, the interesting stuff to her is the stuff she’d never really allowed herself to investigate, never thought she could, or didn’t think she was allowed to, which just breaks my heart.”

Crowd-pleasing … Hahn with Mila Kunis, left, and Kristen Bell in Bad Moms. Photograph: Michele K. Short/AP

This leads Eve down some X-rated alleys: masturbating on the floor to porn, spanking herself over the kitchen counter and having sex with a stranger, all of which echoes her character Carla in the Bad Moms franchise, a crowd-pleasing hurricane of filth. As is now standard for HBO, there was an intimacy coordinator present during the shooting of many risque scenes, while the fact that the show’s directors were all female made for a different atmosphere on set. “Of course you’re going to be nervous,” says Hahn, “but at least I felt heard and safe.”

Porn in Mrs Fletcher is used not just to show how much Eve can learn about herself but also to show how much Brendan’s view of sex and of women has been warped by what he’s seen online. It’s a problem that concerns Hahn in real life. “If the sex you’re seeing is gagging, choking and violence, that’s not real. And if no one is there to say this, it’s a tricky conundrum.”

I try to have courage, even if I am politely declined for my opinion, I will always give it because I think it’s important

This is a “whole new terrifying world” to Hahn. As a mother of two, the internet is a constant cause of angst. She tells me about unintentionally watching a YouTube video of some cute bunny footage with her daughter, who was one, when it suddenly cut to a guy masturbating. She has also been forced to have a chat with her 13-year-old son, concerned about the screen grabs or clips he might find online. “I said: ‘You can’t Google me, please don’t Google my name.’ One day I’m going to be able to explain my choices to him because I’m proud of them but he’s too young to understand them yet.”

Hahn always knew she was going to be an actor (but not, she’s quick to point out, a star). She never considered another option. In college, her friends were the “dumb chain-smoking idiots” she acted with on stage. And, as part of the theatre crowd, she deftly avoided the sort of “entitled white kid” status embodied by her son in Mrs Fletcher. But she has encountered this type since, in moving to Hollywood – the bully who has never had to contend with not getting his own way. She describes herself as “bullish” on the set of the show, though, and collaborated so closely with Perrotta on her character that she ultimately asked for – and was given – a producer credit.

Speaking up ... Kathryn Hahn. Photograph: Ali Smith for The Guardian

“I try to have courage,” she says. “Even if I am politely declined for my opinion, I will always give it because I think it’s important. If I am swallowing it, I will drive home at the end of the day pissed at myself.”

Not only has she learned to speak up, she has also found a way of bringing perspective to any feelings of anger. “I’m angry every time I look at the news, of course,” she says. “I have so much rage but I’m also the mother of two children and life is so short. I feel like anger is so freezing. It can either galvanise you or it can freeze you.”

Given that she has talked in the past of her feelings of anxiety, I wonder how she deals with negative feelings? “Besides copious amounts of marijuana? I’m kidding! Am I? No, I’m kidding. I can’t do it that often, honey, I’m a mother!”

It’s the same for having a drink: she says she feels resentful when she sees people who have the time to take things easy. “We walk by people reading the New York Times with brunch on a Sunday and I want to be like: ‘Fuck you, who has time to do that any more?’” She laughs. “Look at you people with your spread-out New York Times, having mimosas.”

Hahn believes we are currently in “a really galvanising moment” for women and she’s thrilled to be heading to the world of Marvel next, starring in the series WandaVision alongside Elizabeth Olsen and Paul Bettany. “This is such a crazy time in a woman’s life hormonally,” she says. “It’s a whole different ballgame, a thrilling and terrifying trip. Everyone tells you the lights are starting to fade but it’s like, no, you still have so much beautiful life yet.”