Sure. Many countries have had these debates and come up with their own solutions.
https://en.wikipedia.org/wiki/Hate_speech
Here are a few examples:
In Canada, advocating genocide against any "identifiable group" is an indictable offence under the Criminal Code and carries a maximum sentence of five years imprisonment. There is no minimum sentence.
France prohibits by its penal code and by its press laws public and private communication which incites discrimination, hatred, or violence against a person or a group of persons on account of place of origin, ethnicity or lack thereof, nationality, race, specific religion, sex, sexual orientation, or handicap.
In Germany, Volksverhetzung ("incitement of popular hatred") is a punishable offense under Section 130 of Germany's criminal code and can lead to up to five years imprisonment. Section 130 makes it a crime to publicly incite hatred against parts of the population or to call for violent or arbitrary measures against them or to insult, maliciously slur or defame them in a manner violating their (constitutionally protected) human dignity. On June 30, 2017, Germany approved a bill criminalizing hate speech on social media sites.
In the United Kingdom, several statutes criminalize hate speech against several categories of persons. The statutes forbid communication which is hateful, threatening, or abusive, and which targets a person on account of disability, ethnic or national origin, nationality (including citizenship), race, religion, sexual orientation, or skin colour.