Sadly, depending on the specific country it happens in, a defendant might still have to pay significant legal fees just to reach a point where the judge can tell trolls to go away. And that's where the business model kicks in: the trolls will offer to go away on their own if defendant pays them $LikelyLegalFees / 2, making it cheaper than the alternative.
It's like the Kevin Bridges bus-stop joke: https://youtu.be/8W_k7ybGBDg
The intent of the law is a big part of what courts deal with in Roman law/civil law countries too. In Norway statutes are typically fairly general leaving precision to preparatory works, Supreme Court precedent, administrative regulations and the courts. So the spirit and intent of the law is certainly a big thing in at least some non-Anglosphere legal systems.
See https://www.advokatforeningen.no/en/features-of-the-norwegia...
And the Anglosphere is hardly uniform in this respect, in particular in recent decades there has been a proliferation of detailed strict liability laws in England which restrict the courts abilities to interpret the law.
(I am not a lawyer, this is not a legal advice.)
There's a concept known as "willful blindness" (at least in Canada) that covers what I believe you wanted as an example.
Not a lawyer.