Another teacher threatened by Islamists four months after the beheading of Samuel Paty on the street outside his school; five people arrested this week for cyber-harassment and threats against a teenager for her social media posts deemed insulting to Allah: President Emmanuel Macron’s defenders say his government’s planned new law to curb Islamist extremism in France has never been more urgently needed.

“Islamism is a Trojan horse containing a fragmentation bomb targeting our society,” wrote Gérald Darmanin, Macron’s interior minister, in his book Islamist Separatism: Manifesto for Secularism, published this year to accompany the law.

“Faced with an enemy so dangerous and insidious, which we know is a long way from the true religion of the Prophet, it’s normal for the authorities to take unprecedented measures.”

Many French republicans of left and right, including some of Muslim immigrant origin, support the legislation as a bulwark against terrorism and Islamist attempts to control Muslim-dominated districts in the Paris suburbs and elsewhere in France — and it is likely to be approved by parliament and become law by the middle of the year.

Yet the law’s targeting of Islamist radicalism is so contentious and some of its provisions so potentially hard to enforce that the arguments during its passage through the National Assembly this month have sometimes made headlines — even in the midst of the Covid-19 pandemic, which has killed more than 80,000 people in France in the past year.

This week, members of parliament approved clauses banning the issuance of “virginity certificates” and restricting residency permits for those in polygamous marriages. Other clauses impose tighter controls on hate speech and radical content on social media, stop state subsidies for civic groups regarded as hostile to France and forbid local authorities from ordering separate sessions for men and women at public swimming pools.

Among those criticising all or parts of the law are Muslim leaders who complain of Islamophobia; Catholics and other Christians wary of its restrictions on home schooling (no religion is mentioned by name in the text of the law, which is designed “to ensure respect of republican principles”); and extreme rightwing politicians who say it does not go far enough.

Launched in December on the 115th anniversary of the 1905 law separating church and state, the legislation is the latest attempt by Macron to undermine radical Islamist networks that the government says hold sway in mostly urban districts with large Muslim populations from France’s former African colonies.

Home to an estimated 5.7m Muslims among its total population of 67m — the largest such minority in western Europe — France has frequently been targeted by Islamist terrorists and has struggled to integrate large Muslim communities with their roots in Algeria, Morocco and Tunisia.

One concern, raised both by government officials and moderate Muslim leaders, is that younger, French-born Muslims are proving more open to radicalisation and violence than their parents or grandparents.

A key question being debated in parliament is whether the law will have any practical impact on curbing radicalism and Islamist “separatism” — or whether it is a cosmetic exercise to improve Macron’s standing among the rightwing voters on whom he will rely in his campaign for re-election next year.

“There’s a disconnect between the law and the reality,” said Dhaou Meskine, a prominent imam in the northern suburbs of Paris. “Secularism is becoming a new dogma that is imposed by force.”

Even as the debate was under way, Didier Lemaire said he had been threatened and accused of racism and Islamophobia in Trappes, near Paris, for calling on his fellow teachers to protect pupils from “Islamist pressure” following the killing of Paty, the teacher beheaded after a class on freedom of speech in which he showed satirical cartoons of the Prophet Mohammed. Lemaire is now under police protection.

In another case over supposedly blasphemous and anti-Muslim social media posts by a teenage girl called Mila, five people between the ages of 18 and 29 were arrested on Tuesday in different parts of France for alleged cyber-harassment and death threats.

Marine Le Pen, leader of the far-right Rassemblement National and the politician most likely to be Macron’s main rival for the presidency in 2022, has condemned the “Islamist Hydra which is infiltrating itself everywhere”, called for a complete ban on the wearing of the veil in public and mocked the government for refusing openly to name Islamism as the enemy in its law.

“We’re a long way from a text designed to combat Islamism,” she told the government in the National Assembly last week. “The successive changes to the title of the law are a sad illustration of your political retreat.”

Among Macron’s supporters in parliament and at the interior ministry, there is no hesitation on the need for the new law. “We must be very firm in our stand against the enemies of the republic,” said Pierre-Yves Bournazel, an MP helping to shepherd the legislation through parliament. “The idea is to fight against all forms of separatism.”

In the security establishment, where officials pore over domestic intelligence reports on radicalised youths, clandestine Koranic schools and the influence of extremists in all walks of life, the message is even starker.

“The law comes from an observation of the reality on the ground,” said one senior official in Paris who asked to remain anonymous. “We have no choice. If we let things go on, it will get worse — and even become catastrophic in places.”