dwarven justice is useless.
Not actually. There are happy thoughts that the victims of crimes (such as assault, or relatives of someone who was murdered by a dwarf in a tantrum) get when the criminal is punished.
_Some_ very lawful dwarfs will get happy thoughts when justice is done, but in my experience this is tied to soul attributes (the vast majority of dwarfs don't derive happiness from that) and expands far beyond victims - i had a case where the relatives of the "criminal" got happy thoughts when she was justicemurdered and her child doomed to dehydration. In general, those happy thoughts are very minor and don't make up for the massive damage "justice" currently causes (like dwarfs dead from a beating or dehydrated in jail - death causes much more unhappiness than tardy punishments). Similarly, nobles' unhappiness over delayed punishment is very minor and can safely be ignored.
I don't institute justice when tantrums rage and am more likely to dissolve guards at such a time, because the guard just spreads unhappiness, which certainly is not useless: it's directly harmful when too much unhappiness is already your problem.
In my experience, the vast majority of tantrumming dwarfs will calm down and stabilise eventually, they're _not_ "going to go crazy anyway". If your tantrummers all go insane, chances are pretty good that they do so because you insist in sticking them in prison, making matters much worse - being confined seems to be a cumulative bad thought, which adds up to quite a lot over a longer time.
@captain of the guard - just assign no ammunition to the squad. But since guards don't shoot criminals, giving them ammo is the better choice - they can effectively take down annoying wildlife or kobold thieves this way.