In the wake of recent attacks in France, a rule of thumb appears to be emerging: of course we should be free to mock Islam, but we should do it with respect. This might seem irreconcilable, but in practice is perfectly achievable.

Satire has been a tool for expanding the boundaries of free expression since Aristophanes. It does so most effectively by being hyper-aware of those boundaries, not ignorant of them. When it is done with the sole intention to offend it creates disharmony. When the intention is to entertain and challenge, the effect is quite the opposite.

Recently I played Arshad – a sort of cuddly version of Abu Hamza – in David Baddiel’s musical rendering of The Infidel: a farce in which a British Muslim discovers he is adopted and is actually Jewish, on the eve of his son’s nuptials to a fundamentalist’s daughter. The entire cast and creative team were obsessively attentive to religious detail, both Muslim and Jewish. Precisely how do women tie the niqab? What is the correct pronunciation and meaning of HaMotzi? With which hand would a Muslim hold the Qur’an, and how? Which way is the tallit worn, and why? Hours of research and discussion.

Backstage, after a particular scene in which we did a stylised cipher based on morning prayers, we folded our prayer mats carefully and put them away respectfully. They were just props, so why did it matter? Because they looked like prayer mats and seeing them discarded grated on members of the team who came from a Muslim background – even if they were not religious. Such instincts are deeply ingrained.

All this may seem precious, especially when one is about to launch into a ska musical number entitled Put a Fatwa on It, but it is not. The point is artistic control. You want to challenge an audience in precisely the way you intended – not because you are eating with the wrong hand. One is not careful out of a fear to offend, but out of a fear to offend randomly. Just because something is a legitimate target does not mean that one should have a go at it with a rocket launcher. Rockets inflict collateral damage.

Some years ago, I stood on the stage of the Yorkshire Playhouse in Leeds and burned a copy of Salman Rushdie’s The Satanic Verses. I have never been more nervous during a press night. It wasn’t a real copy of the book, but a metal box with a jacket on, soaked in lighter fluid. And I wasn’t a real Leeds Pakistani hate-preacher, but a Greek actor with a costume on, soaked in perspiration.

The play was Hanif Kureishi’s The Black Album, a comedy charting the battle between a liberal lecturer and an Islamist scholar for the soul of a young British Pakistani student, against a backdrop of the last years of Thatcher and the Rushdie fatwa. I had burned that book night after night for months at the National Theatre. Why was I nervous? Because this was the opening of our tour and we were keenly aware that London success was no guarantee of audience reaction elsewhere. In the event we were pleasantly surprised. The audience reacted even more warmly than its capital counterpart.

I have always been fond of extremists, professionally speaking. My colouring has meant that I have played a range of them, from Kureishi’s Riaz all the way to Baddiel’s Arshad. I have given spittle-flecked sermons on bringing death and destruction to the decadent west on many occasions. At the same time I have been religious extremist and irreverent satirist. This has given me a unique perspective. I arrived at a place of being acutely aware of both the disrespect in burning that book (I had met Rushdie only weeks before) and the disrespect felt by the zealot.

Do we tiptoe around Islam more than other religions? Most probably. But we will only get better at making fun of it with practice. The crucial question becomes whether satire is worth the bother. It is the question my agent asked me before I accepted the part. It is the question producers assessing The Infidel for a West End transfer are quite legitimately asking.

The answer must be a thunderous yes. Night after night we saw packed houses of mixed audiences come together in laughter, hungry for a little irreverence in a rather po-faced world. I remember a rabbi and a woman in a full burqa on the front row, laughing with abandon: laughing at themselves, at each other, giving one another permission to laugh, to burst the balloon of pomposity. We need a lot more of that after the attack on Charlie Hebdo, not less of it.