Every joke has a victim.

Comedy can be considered to be a crime, in that it is akin to causing hurt by physical means.
Indeed comedy has been known to cause demonstrable physical harm to the objects of the comedy.

I have Googled  "make comedy a crime" (and similar) & there is almost nothing there.
Though you may find some distubing entries to curl your toes !

Actions for slander & libel have been  enacted as a result of apparent comedic references.

There can be no doubt that jokes can be considered to be racist, sexist & socially offensive.

(Did you hear the one about the congenitally mentally disabled Jewish dwarf, with the unmarried, lesbian black mother  ? )

Our problem is; how can we manage to criminalise comedy, without making the legislation itself a comedy ?

In some societies, apparently simple comic remarks are seen as serious offences against the objects of the comedy.
Punishments are administered that are similar to those for assault, and murder !

In those societies, the citizens accept that some subjects are sacrosanct because of faith or tradition.
In England, until quite recently, it was an offence, punishable by imprisonment, to make jokes about the Anglican faith .... blasphemy. Jokes about other faiths were OK !
There are also examples of where political masters have used the sanction to protect their own self interests.

Right; .....let's start by accepting that comedy is an offence against personal health.
Also, let's assume that this is to be UK (or Scottish) law.

Elsewhere ....... in "Crime & Punishment" .... I have set out  my "points" system.

Here, let us consider a similar points grading system. i.e. there are various levels of offence for various types of comedic utterances.

A starting point could be :-  "Common Assault" .... this could be equal to "An Englishman, an Irishman & a Scotsman ... " joke.

At the other end of the spectrum; the equal offence to manslaughter could be jokes about a stuttering, disabled, lesbian, black, Catholic, single mother who has 17 children. Jokes about the Royal Family could be equal to premeditated murder !

Well ............. there it is. I have brought out the tumbrels .......
 you must now decide how you are going to fill them ............
 Or leave things as they are.