Since the Middle Ages, Scots have been entertaining themselves during the long winter nights with a dialectical tradition called “flyting”. This is a form of conversation in which you knowingly subject your friend or colleague to verbal violence and insult. Weepy millennials should not try this at home.

Flyting began in the 16th century as a contest between poets, or “makars”, to see who was capable of the most imaginative invective – a bit like rap. It became a widespread mode of social intercourse among working people in homes and hostelries. The abuse is, of course, an ironic form of affection, of bonding – a demonstration that your relationship is so strong that you can playfully abuse each other. But it’s something that is almost impossible to explain in the age of social media and the tyranny of the literal. And with the SNP’s Hate Crime Bill now passed into law, flyting is finally grounded.

Scotland now has the dubious honour of being the only country in the Western world where the state polices what you say even in the privacy of your own home. One of the most egregious aspects of this legislation is the explicit removal of a “dwelling defence”, the clause in the old Public Order Act which ruled that speech in the privacy of your own home is of no interest to the law. The Justice Secretary, Humza Yousaf, evidently thinks Scots have been planning Nuremberg rallies in their kitchens so he dropped it.

Even in its now much-amended form, the Hate Crime Bill is an offence against civil liberty. It introduces a new crime of “stirring up hatred”, a concept which has become ever muddier as this Bill has staggered through committee hearings in Holyrood. Whenever Mr Yousaf is asked to explain what “stirring up” involves, he invariably cites the need to protect racial minorities from “threatening and abusive behaviour”. Yet threatening and abusive behaviour is already illegal, not least under the 2010 Criminal Justice Act. Incitement to racial hatred is also illegal.

This legislation has nothing to do with incitement and is transparently about restricting expression to placate keyboard warriors and narrow-minded identitarians. The taking of offence has become a national obsession and this Bill is the latest extension of it. It is not just freedom of speech advocates who are worried about its implications.

The Scottish Police Federation don’t want to go around policing “what people think and feel”. Officers are particularly averse to the prospect of entering people’s homes to collar grandad for saying something nasty about Meghan Markle’s skin colour, or mum for saying that people with penises are men. This is nonsense on stilts, but the police will still have to investigate family spats using up valuable time.

Moreover, police are required to record any reported hate crime, however spurious, as a “non-crime hate incident”. This is defined, by Police Scotland’s website, as: “something which is perceived by the victim or any person to be motivated by hate or prejudice”. It’s sometimes called the Tommy Robinson Clause because even he could claim that he’s a victim if a Muslim calls him racist.

You don’t even have to be a “victim” yourself. Anyone who overhears something offensive can report a hate incident and the police will be required by law to record it. This will rarely lead to actual prosecution, but it carries a punishment nevertheless. The mere recording of a hate incident will hang around the neck of whoever is accused of it, and could be dredged up when they apply for jobs involving childcare or race relations.

Attempts to include a freedom of speech defence in the Hate Crime Bill have been risible where they aren’t self-contradictory. Ultimately the decision is down to that convenient legal fiction “the reasonable person” to decide when insult, ridicule and disrespect becomes “stirring up hatred”. But this merely presents us with the paradox of how a reasonable person can interpret an unreasonable law.

Mr Reasonable presumably doesn’t attend independence marches displaying banners saying things like “F-Off Tory Scum”. The first casualties of the Hate Crime Bill could well be legions of SNP supporters who have arguably been “stirring up hatred” online for years by saying offensive things about English people. How does a reasonable person view idiots in hazmat suits gathering at the Border during lockdown telling English to “f-off back home”?

Feminists feel particularly vulnerable. Women like the SNP MP Joanna Cherry and the MSP Joan McAlpine are frequently accused of hate speech for refusing to accept that transwomen are women. The Scottish Trans Alliance summoned a police investigation into feminists who posted signs in Edinburgh University quoting the English dictionary: “Woman. Noun. Adult Human Female.” Groups like STA insist that it is “not the words themselves but the way they are used” that constitutes hate crime.

Prominent feminists like the former Labour leader Johann Lamont tried to include sex as a protected characteristic as well as transgender identity. She thought it rather odd that, on International Women’s Day, women were being left out. She had argued for an amendment to specifically protect women who argue that men cannot change sex, but that was dropped by Mr Yousaf, who is offering a review of misogyny instead.

The Bill is riddled with such irrationalities. There is explicit protection of people who express “antipathy, dislike, ridicule or insult” towards religion. But for things like age and gender only “criticism and discussion” is specified. There are protections for playwrights, but not people in their homes. Blasphemy is abolished and reinvented as hate speech. Comedians remain extremely exposed to attention-seeking campaigners.

The law is almost certainly unworkable in practice. However, it can do immense damage merely by being on the statute book. It will not just “chill” freedom of expression but place it in the deep freeze. The former deputy leader of the SNP, Jim Sillars, has described the bill as “one of the most pernicious and dangerous pieces of legislation”. Concern has been echoed by everyone from the National Secular Society to The Sikh Network. I can think of no other piece of legislation in recent times which has so united churchgoers, atheists, police, feminists and libertarians in condemnation of legislative folly.

Most ordinary SNP members are mystified as to why the Hate Crime Bill ever saw the light of day. It threatens to be even more perverse and indiscriminate than the Scottish Government’s Offensive Behaviour at Football Act, which criminalised football supporters and had to be repealed in 2018. It is arguably worse than the named persons scheme, which sought to install a state guardian for every child, and was struck down by the UK Supreme Court because it infringed the European Convention on Human Rights.

The ECHR also protects freedom of expression, so there remains hope that the Hate Crime Bill will also fall foul of human rights law. But by then the damage will have been done. This assault on free speech follows the high-handed and unlawful handling of the Salmond investigation and the recent costly scandals involving the Crown Office.

If the SNP can no longer be trusted to guard essential civil liberties, what does that mean for an independent Scotland?