You're not allowed to insult anyone, https://www.gesetze-im-internet.de/stgb/__185.html , though the term "insult" is not nearly as broadly defined as in everyday speech. The law dates back to the 18th century, and has largely been unchanged for 150 years. I really don't understand the recent outrage over these and other laws. We have been fine.
More background: https://de.wikipedia.org/wiki/Beleidigung_(Deutschland)
The last 150 years of Germany have...ahem...not been what I would call "fine."
It would be interesting to have a replay of history without this law and similar ones related to it. Could be nothing different happens.
On the other hand, any law regulating speech is going to have a reverberating effect on the marketplace of ideas with 2nd and 3rd order outcomes that are impossible to disentangle after the fact.
But it's certainly not been because of that law…
At the very least I'm sure you'll agree we've been fine the last 80 or so years. Again, I'm just saying I don't understand the outrage right now.
Germany restricts insulting individuals / your neighbour, police officer, a pastor or a minister. There’s no special law for politicians. Political criticism is protected under the Basic Law (constitution). Go ahead and be crucial about a politician’s actions but don’t insult their person’s honour or use a slur. That’s not your freedom of speech, that’s the dignity. In fact, you can even insult the government! You can say German government as the government is not a person.