"This has nothing to do with Islam," say the imams. "These callous and fanatic murders have nothing to do with us," say the mullahs. "Islam means peace," say the worshippers. These disclaimers, and variations on them, have been repeated countless times by Muslim commentators since the Charlie Hebdo killings. They are designed to distance people from guilt by association with those who kill and maim in the name of Islam.

But what about the sentence recently handed down to the (mildly) liberal blogger Raif Badawi in the Islamic state of Saudi Arabia? Ten years in jail, a massive fine, 1,000 lashes over 20 weeks (currently suspended because the first 50 lashes have rendered him "medically unfit")? Does this have "nothing to do with Islam"? Does the hashtag "Je suis un couteau" – referring to this week's stabbing of 11 Israelis on a bus – have "nothing to do with Islam"? Not to mention the 10 Christians killed during Charlie protests in Niger last week, or the ongoing depredations of al-Qaeda, Isis, Boko Haram, the Taliban and the Laskar Jihad of Indonesia?

The psychotic followers of these organisations all think that they are Muslims, and their Islam is based on beliefs that millions who subscribe to Wahhabism, the Saudi version of the religion – and its kin, Salafism – accept as essential ingredients of their faith. For example, that sharia, or Islamic law, is divinely ordained and immutable; that apostates and blasphemers should be killed; that women should be shrouded and confined to four walls and that men are their guardians.

This is a widespread version of Islam, made more so by modern communications; increasingly gaining followers in Europe, it can be, and is, used to justify all manner of atrocities. Yet this is an Islam of manufactured dogma which relies on neither the Koran nor the example of the Prophet Mohamed.

So where do these beliefs come from? From today's extremist leaders, of course. But also, historically, from caliphs and clerics who realised that religion could perform a very useful function: it could keep the masses in their place and ensure that power remained in the hands of a select few.

Anti-Charlie Hebdo protests around the world Show all 23 1 /23 Anti-Charlie Hebdo protests around the world Anti-Charlie Hebdo protests around the world Pakistan Pakistani Islamists burn a French flag during a protest against the printing of satirical sketches of the Prophet Mohammad by French magazine Charlie Hebdo in Quetta, Pakistan on 22 January 2015 Anti-Charlie Hebdo protests around the world Afghanistan Afghan demonstrators set a French flag on fire during a protest against the printing of satirical sketches of the Prophet Mohamed by French magazine Charlie Hebdo in Jalalabad on January 19 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Afghanistan An Afghan boy holds a placard during a rally against the French magazine 'Charlie Hebdo' Jalalabad, Afghanistan, 19 January 2015 EPA Anti-Charlie Hebdo protests around the world Afghanistan Afghans chant slogans during a protest against cartoons published in French magazine Charlie Hebdo in the city of Jalalabad, on 19 January 2015 AP Anti-Charlie Hebdo protests around the world Iran Protesters clash with members of the Iranian security services during a demonstration against Charlie Hebdo in Tehran on 19 January 2015 EPA Anti-Charlie Hebdo protests around the world Iran Iranians carry a placard bearing the picture of Jihad, the son of assassinated senior Hezbollah commander Imad Mughniyeh, during a protest against Charlie Hebdo outside the French embassy in Tehran on 19 January 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Niger People run past a police car on fire by protesters during a demonstration against French weekly Charlie Hebdo's publication of a cartoon of the Prophet Mohamed in front of the grand mosque in Niamey AFP/Getty Images Anti-Charlie Hebdo protests around the world Niger A church, which was damaged after it was set on fire by protesters during a demonstration against French weekly Charlie Hebdo's publication of a cartoon of the Prophet Mohamed in Niamey, AFP/Getty Images Anti-Charlie Hebdo protests around the world Niger A police van set on fire by protesters during a demonstration against French weekly Charlie Hebdo's publication of a cartoon of the Prophet Mohammed in Niamey AFP/Getty Images Anti-Charlie Hebdo protests around the world Niger Smoke billows in a street as people demonstrate against French weekly Charlie Hebdo's publication of a cartoon of the Prophet Mohamed near the grand mosque in Niamey, on 17 January 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Chechnya People attend a state-organised rally against the publication of cartoons of the Prophet Mohamed by Charlie Hebdo in the Chechen capital Grozny on 19 January 2015 AP Anti-Charlie Hebdo protests around the world Chechnya People pray during a state-organised rally against the publication of cartoons of the Prophet Mohamed by Charlie Hebdo in the Chechen capital Grozny on 19 January 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Chechnya Chechen President Ramzan Kadyrov speaks an anti-Charlie Hebdo rally in Grozny on 19 January 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Philippines Women protest in Marawi, Philippines, over Prophet Mohamed depictions AFP Anti-Charlie Hebdo protests around the world Philippines Protesters in Marawi, Philippines, burn a poster with the face of Israeli Prime Minister Benjamin Netanyahu Getty Anti-Charlie Hebdo protests around the world Pakistan Pakistani protesters shout slogans during a protest against the printing of sketches of the Prophet Mohamed by French magazine Charlie Hebdo, in Lahore on 18 January 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Pakistan Pakistani demonstrators burn the French flag during a protest against the printing of satirical sketches of the Prophet Mohamed in Charlie Hebdo, in Peshawar on January 19, 2015 AFP/Getty Images Anti-Charlie Hebdo protests around the world Pakistan Supporters of banned Islamic charity Jamat-ud-Dawa rally against a decision by the controversial French magazine 'Charlie Hebdo' to publish a depiction of the Prophet Mohamed, in Lahore, Pakistan, 18 January 2015 EPA Anti-Charlie Hebdo protests around the world Mali Thousands of people take to the streets of the Malian capital Bamako on January 16 to protest against Charlie Hebdo AFP/Getty Images Anti-Charlie Hebdo protests around the world Mali People hold up signs as they rally against Charlie Hebdo in Bamako on 16 January 2015 Reuters Anti-Charlie Hebdo protests around the world Algeria Demonstrators burn the French national flag after Friday prayers in Algiers January 16, 2015 Reuters Anti-Charlie Hebdo protests around the world Algeria Demonstrators clash with police in anti-Charlie Hebdo protests after Friday prayers in Algiers January 16, 2015 Reuters Anti-Charlie Hebdo protests around the world Algeria Demonstrators clash with police in anti-Charlie Hebdo protests after Friday prayers in Algiers January 16, 2015 Reuters

The prime example of this thought-control is the notion is that sharia law is divinely ordained and must be accepted in its totality without question. In fact, its ordinances were invented in the 9th century CE – about two centuries after the Prophet Mohamed's death– during the Abbasid rule of the Muslim Empire. The law of apostasy, for example, was formulated to discourage revolt against the imperial state.

As for state-sanctioned blasphemy laws – now regarded as sacrosanct in Pakistan, Egypt and other Muslim counties – they were actually first introduced by the colonial powers in the 19th century, to keep the peace between the different religious communities that they ruled. In Pakistan, for example, blasphemy became a crime in 1860, when the territory was still part of a greater India. Inherited after partition in 1947, in 1982 the statutes were expanded and their penalties made harsher by the military dictator Muhammad Zia-ul-Haq to bolster support from ultra-conservative religious parties. Now they are seen as divine revelation!

But tightening the screws has long been the way in the Muslim heartlands. For example, in a highly influential decree from the 10th century CE, the Abbasid caliph Abdul Qadir, denounced critical thought as "counter to Islam" and ordered his subjects to dissociate from philosophers and freethinkers, who were required "to repent", despite the fact that numerous verses in the Koran exhort believers to think, reflect and raise questions.

Four hundred years later, when power had shifted from Abbasid Baghdad to Mamaluk Cairo, religious scholars banned independent reasoning on issues of faith – or as the formula has it, "closed the gates of ijtihad". In doing so, they laid claim to have solved all the problems of humanity. In fact, they shut the door on the Enlightenment, which already-established Arab scholarship would do so much to kick-start.

And still it goes on, with recent attempts to suppress critical thought verging on the absurd. In September 2011, a Saudi cleric called for astronomy to be banned, and astronomers punished, because it encouraged scepticism about sharia. (This despite the fact that astronomy, regarded as an "original Muslim science", has a distinguished history in Islamic civilisation.) This month, a Saudi cleric issued a fatwa forbidding the building of snowmen because they represented human beings and are therefore forbidden by sharia law.

Jafar Umar Thalib, commander of the Java-based militant group Laskar Jihad, preaches at a mosque in Aceh, Indonesia, in 2002 (Getty) (Getty Images)

The essential message of these historic and contemporary decrees is clear: the self-appointed guardians of Islam must be revered not cross-examined. The rules handed down and conjured up today must be accepted, not interrogated. The pronouncements of imams and sheikhs, mullahs and ayatollahs – whether educated or semi-literate – are both the word and will of God.

But despite what these religious despots would have their followers think, in fact Islamic history is full of free thinkers who have stood up to such authoritarianism. During the 8th century CE, when sharia law was being shaped, the Persian writer and thinker Ibn al-Muqaffa declared that it had the potential of becoming a political tool in the hands of kings and clerics manipulating the rough and credulous. And during the 9th and 10th centuries, a host of writers, satirist and free thinkers joined him in denouncing dogmatism.

The accomplished theologian Ibn al-Rawandi mocked religious scholars and the nonsense they peddled about a Paradise full of virgins. (Could it be pleasing to anyone but a rustic, he wondered.) His contemporary, the polymath and natural scientist Abu Bakr al-Razi, insisted that Islam without reason had no value. The renowned blind poet Abul "Ala" al-Ma'arri sought to correct "what established religion took for God's criteria".

Their contemporary, the scientist Abu Rayhan Al-Biruni, who is regarded by some as a free thinker not only of his age but across all ages, insisted that it was essential to question everything – from religion to philosophy – and to respect criticism, including of one's religion, in order to benefit from its arguments. And the 12th-century philosopher Ibn Rushd, who later had huge influence on European thought, argued that matters of belief should be decided only on the basis of reason and evidence – a position deemed so dangerous that his numerous books were banned, and Ibn Rushd himself was briefly banished.

Jailed blogger Raif Badawi, pictured with his children

From their different perspectives, these and numerous other free thinkers of Islamic history arrived at a common conclusion: state-sponsored Islam is full of edicts and rituals that are absurd and insulting to reason. Free thought was the only way to cut through this nonsense and take us closer to God.

So why don't we hear more about these great thinkers and questioners today? Because concentrated attempts have been made, and continue to be made, to stifle free thinking and wipe its record from Islam's history. The traditional curriculum, unchanged for centuries, in most madrassas, seminaries and "Islamic universities" is devoted solely to the works of "approved" imams and scholars, and even the minutest critical thought is ruthlessly expunged. (In Saudi Arabia and most Gulf states, for example, it is forbidden to teach the ideas and works of Ibn al-Rawandi, Ibn Rushd, and al-Biruni.) In recent years, Saudi Arabia's rulers have spent £70bn in attempts to suppress critical thought – funding mosques, madrassas, universities and tele-evangelicals – with the result that generations of Muslims around the world, including Britain, now imbibe the Wahhabi ideology.

Luckily, though, not all. There are still some contemporary thinkers following in the footsteps of the classical intellectuals. The late Nasr Hamid Abu Zayd, an Egyptian who died in July 2010, declared that sharia was "man-made" and that the Koran was deliberately manipulated by religious scholars to justify their unquestionable authority. For wanting a more humanistic and contemporary interpretation of the Koran, he was labelled an apostate, required to divorce his wife and hounded out of his country. Similarly, the 69-year-old Abdolkarim Soroush – who has argued that Islam cannot rely on the dogmatic certainties of the past and urgently requires rethinking – has been forced into exile from Iran.

The critical Syrian poet Adonis (Getty) (Getty Images)

Again, the great Syrian poet Adonis, 85, has been declared a heretic and imprisoned for his beliefs, simply because he wants to re-frame the whole notion of God in Islam. The orthodox, God, he says, is represented as the vengeful patriarch of an Arab tribe. He questions this characterisation of Allah as remote, perpetually angry and without mercy, ever ready to punish even the tiniest deviation from "correct belief" and unable to be depicted lest the gullible masses mistake the portrayal for the real thing. And in his works he seeks a human connection with a God who is always near and merciful.

Today, as in history, all attempts to rethink our understanding and relationship with God, to interrogate orthodox belief, to bring reason back to Islam, are shunned – not just by the fanatics but by the vast majority of Muslims. The manufactured articles of faith seem to have an unassailable hold on Muslim minds. And so the moderate free thinkers' legacy, so vital at this time of sectarian warfare within Islam, is swept collectively under the carpet of accepted, if artificial, doctrine.

This phenomenon is the central problem in all varieties of Islam. In the absence of reason and criticism, the heritage has become toxic. At best, it promotes intolerance and bigotry; at worse, it manifests itself as fanaticism and violent jihadism. And until more Muslims question it, they cannot claim that its manifestations have "nothing to do with Islam".

Our best hope of dealing with extremism is to challenge the doctrines manufactured by religious scholars, from the past and present. The distinguished history of critical thought in Islam must be brought back from the periphery to the centre. And if its spread is hindered in the Muslim heartlands, then it must be exported back from the West.

In Britain, for example, it should be an essential part of the curriculum whenever and wherever Islam is taught – including faith schools and seminaries such as the Darul Ulum in Birmingham – as well as in any comparative religion classes. There should be a proper system of certifying imams, who clearly need much more than a traditional education that simply perpetuates uncritical acceptance.

What's more, British Muslims need to create and defend the freedom to question and, if necessary, reject religious authorities of the past and present. And why can't we see this theme explored on television, instead of the usual programmes about terrorism and the hajj? If nothing else, a TV series on free thought in Islam would supply some material to Westerners, so that they could engage with Muslims in a discourse based on mutual respect.

Finally, let us be heard. No doubt many Muslims want to protest against jihad. But, at the very least, we should also be rallying against the Saudi hijacking of Islam. You may "be" Charlie, and much good may it do you. But we'll know progress has been made when – outside the mosque – instead of "Je suis un couteau", we see signs saying: "Je suis Raif."