The ad hominem attack of mental illness accusations used to quell or impeach a political dissident. In extreme cases it leads to the medically unnecessary comital of the dissident to a mental institution and/or the forcing of the dissident to take pacifying or punitive medication.
It is a particularly effective method for totalitarian regimes as they can shield the public from viewing evidence supporting the claims of the dissident. It is also effective when the dissident has inherently eccentric behavior that can be magnified by the frustrations of dealing with the government's accusations.
With freedom of the press and the internet it is becoming an increasingly rare tactic.
The best defense is to communicate through an attorney, remain calm at all times, and amass as much evidence as possible before raising further dissent.
Soviets, Maoist China, Nazi Germany, Ceausescu Romania, ...
Doctor Johnson is engaged in political psychiatry to keep a lid on the mayor's corruption. The mayor paid Johnson to say Mr. Smith is crazy so the press would stop giving him interviews.