There’s a moment in Ricky Gervais’s 2018 Netflix stand-up show Humanity when he talks about buying a first-class air ticket, only to be informed that nuts would not be served on board due to a fellow passenger’s serious allergy. ‘I was fuming,’ he says. ‘If being near a nut kills you, do we really want that in the gene pool? I’ve never wanted nuts more. I felt that she was infringing on my human right to eat nuts.’

A member of the public tweeted him directly to complain after hearing him tell this story on The Tonight Show, but instead of apologising Ricky wrote a routine about it. As he points out, when someone is needlessly offended, ‘it makes it funnier’. Contrary to those who argue that political correctness is killing comedy, he insists that it is driving it.

I meet Ricky at an editing suite in central London where he’s putting the finishing touches to the second series of After Life, his Netflix comedy drama about a man struggling to come to terms with the death of his wife. I’m particularly interested to hear his thoughts on our culture of offence-taking, a phenomenon that appears to have been galvanised by social media.

‘Everyone’s thing is the worst thing in the world,’ he tells me. ‘We all do it. We go to a show and say “I wish he hadn’t joked about that. That’s the thing I care about”.’ He recalls playing in New York for the first time and receiving a letter from a Jewish society upset about his Anne Frank material. ‘I said to them, “You laughed at the jokes about famine, Aids and cancer. You knew I was joking there, didn’t you?” I’m playing the idiot. That’s what irony is. It’s the opposite of what you actually think. You wouldn’t satirise an idea that you fundamentally agreed with and get excited about it as an artist.’

Just as many seem to struggle with the notion that a joke is not the direct expression of a comedian’s feelings, there are those who judge fiction through an ethical lens. Some viewers took exception to a subplot in the first series of After Life, in which Ricky’s character, Tony Johnson, encourages a drug dealer to kill himself.

‘I could explain it,’ he says. ‘I could explain that the character was at his lowest ebb and he didn’t know what he was doing and there is an ambiguity of morality and not everything he does is the right thing.’ Ricky mentions the famous scene in the first series when Tony calls a child a ‘tubby little ginger cunt’. This isn’t acceptable behaviour, Ricky tells me, ‘but it’s funny because comedy is the undermining of the societal norm’. When it comes to killing the drug dealer, Ricky says he is bored of the expectation that he should defend himself. ‘Now I just say the actor asked for too much money.’

The idea that comedians have a responsibility to convey ‘the right message’ is more prevalent than ever. Following the announcement that Ricky would be returning to host next month’s Golden Globe awards after four years away, he was taken to task by one young American critic for his supposed ‘transphobia’ — I put to him that this is the kind of charge that could have been laid by Mary Whitehouse at the height of her ‘Clean up TV’ campaign 50 years ago. ‘Well, that’s the thing, isn’t it?’ he replies. ‘The new puritans aren’t 60-year-old women in twinsets and pearls, the Christian right trying to make us turn off our televisions because they don’t like it. It’s a younger crowd with trendy haircuts, who you’d think would have left-leaning liberal sensibilities, who have invented this new term “hate speech”.’

Many of Ricky’s detractors take issue with the jokes he told about Caitlyn Jenner while hosting the 2016 Golden Globes, but he is adamant that he has always supported trans rights. ‘There are many trying to say the subject of the joke is the same as the target, but it’s not. The word “transphobia” has been watered down through misuse. It couldn’t have been done better by real transphobes.’

That said, he insists that not all trans activists should be seen as complicit with the more illiberal elements of their movement. ‘These so-called activists, the mouthy ones, are the wrong ’uns. They’re the people who go on a good march to smash windows and they make the 95 per cent who are peaceful marchers look bad. I really admire the trans people who are standing up and saying, “No, this isn’t us”.’

He applies the same principle to joking about other forms of prejudice. ‘You can make jokes about race without being racist. The people who’ve had to endure real racism throughout their lives are the ones being hurt, because now the term “racist” is meaningless. It went from someone who was filled with vitriol and hate and oppressed particular races to meaning a bloke who didn’t let you park where you want. The word “Nazi” used to mean someone who wanted to take people to a concentration camp. Now it means fighting for someone’s right to say whatever they like.’

The counter-argument to Ricky’s view that anything can be a subject for comedy is that a comic must always ‘punch up’, and that by joking about trans or race issues Ricky is taking aim at the marginalised. ‘There are lots of things wrong with that. Who decides what’s punching up and punching down? I have a routine [in his new stand-up tour, Supernature] about these comedians writing articles in the Guardian, trying to set the rules of comedy, insisting that we should never punch down. And I say sometimes you’ve got to punch down. Like if you’re beating up a disabled toddler.’

That’s the kind of line that could so easily be taken out of context and used as ammunition against him. Perhaps it’s a failure among certain critics to appreciate the theatricality of stand-up. It’s the ambiguity of intention, the oscillation back and forth from the persona to the authentic self, that makes the medium so exhilarating. ‘People think that comedy is like the window to your soul,’ he tells me. ‘Well, it isn’t. A lot of the things I say I don’t believe. And it’s a sliding scale. It’s non-binary. Sometimes I mean it and sometimes I 100 per cent don’t mean it. And if I have to explain which bits I mean and which I don’t, that destroys it.’

In the past, the fear of being misconstrued has led him to delete jokes on Twitter. These days he takes a different view. ‘What’s the point? Why should I expect everyone in the world to get my joke? That’s arrogant. I don’t want to go so low and obvious and anodyne that everyone gets it. Now I challenge people to tell me a joke that’s not offensive and I can find something offensive in it. “Why did the chicken cross the road?” Fuck you, my chicken died yesterday.’

There is something inherently funny, as well as deeply entitled, about those who believe that stand-up comics should be able to anticipate the personal boundaries of strangers before writing their material. ‘I want people to stop saying “That joke is offensive”. You should say you found it offensive because you’ve got to own the emotion. That’s all it is. It’s an emotion, an opinion. As a comedian you can’t please everyone. If you try you’ll end up pleasing no one and saying nothing.’

When the Twitter mobs come, he is never tempted to apologise. ‘You mustn’t, because that’s the end. The end of satire and the erosion of freedom of speech based on people’s feelings will have a catastrophic effect. It’s not just that comedians will be a bit grumpy or won’t be able to say things. It’s not the same as not allowing Bernard Manning to say the N-word on TV. It’s something much, much darker and more Orwellian. It really is.’

He considers ‘hate speech’ to be the invention of those who ‘feel they shouldn’t have to hear something they don’t agree with, and want to complain. They can call the police because someone’s wearing a T-shirt they don’t like. This is actually happening.’

By way of illustration he mentions the recent case of Harry Miller, the ex-policeman who was investigated by Humberside police for retweeting a poem deemed to be transphobic. Miller is currently challenging the police investigation in court. ‘The judge reminded the court that freedom of speech outweighs the right never to hear something you don’t like.’

Then there was the comedian Jo Brand, who was investigated by police in June for a joke on the BBC Radio 4 show Heresy in which she addressed the trend of throwing milkshakes at controversial political figures. ‘Why bother with a milkshake,’ she said, ‘when you could get some battery acid?’

‘That was clearly a joke,’ he says with unconcealed exasperation. ‘She doesn’t really think that Nigel Farage should be doused in acid. Not in a million years. But within minutes on Twitter people were saying, “Oh, it’s OK for a comedian to throw acid in someone’s face”. But she didn’t throw acid in someone’s face. What you’ve done there is you’ve mistaken a joke for an actual crime.’

Brand eventually apologised for her quip, calling it ‘crass and ill-judged’. I suggest that if more comedians stood by their material it might help to combat this censorial climate. ‘I don’t think they should have to apologise,’ he says, ‘but it’s up to them. I’ve seen actors say terrible things and then say sorry because they’ve got a film coming out the next day. If you want to do that, that’s fine. I don’t do it on principle. I don’t mean I never apologise; that would make me a psychopath. I mean I don’t back down and I don’t try to change history. I evolve. I’m sure I’ve told jokes ten years ago that I wouldn’t tell now because they wouldn’t fly.’

His refusal to apologise is perhaps why the pearl-clutchers of social media have taken such umbrage at the news of his return to the Golden Globes. Unlike the comedian Kevin Hart, who withdrew from hosting the Oscars after allegedly homophobic jokes from many years ago resurfaced online, the mob’s ‘cancel culture’ tactics simply haven’t worked with Ricky. If anything, the collective bleats of indignation have made him a more appealing prospect. Besides, anyone who has seen his previous hosting appearances will know that he most definitely takes the opportunity to ‘punch up’ at such events.

‘On the face of it, it’s a room full of the biggest virtue-signallers and hypocrites in the world, so I’ve got to go after that. I vaguely satirise myself as well, playing to the press perception that I’m the bad boy, the outsider, that I might be drunk. None of which is true, but it would be nauseating for me to come out and say, “Hi Brad, see you tomorrow. Hey, George, thanks for letting me use your villa”. I’m trying to make people at home laugh as well as the people in the room. I’ve got to make it a spectator sport.’

In spite of the offence-seekers and their bullying tactics, he is optimistic about the future of comedy. People are not angrier in general, he says — it’s just that social media has made anger more visible. Before the digital era, he says, ‘we couldn’t read every toilet wall in the world. And now we can’.

He believes that the puritanical trend is ‘already on the turn’. I end our conversation by asking how comedians might hasten its demise. ‘Ignore it,’ he says. ‘You keep doing what you always did. I’ve lived through probably three phases of new wokeness in my time, it comes and goes and it has different guises. Freedom of speech isn’t freedom from consequences, unless those consequences are government interference and violent retribution. If I tell a joke, people are allowed to hate me for it. They’re allowed to never buy a ticket. They’re allowed to say something nasty back. They’re allowed to call for my banning. They’re allowed to do all that. Bring it on. It’s fun!’