Mar, who police said had violent tendencies, contended that fear of an accidental zap — one of the commonplace hazards of stun belts — could prejudice his case by making him appear nervous and guilty on the witness stand.

On Wednesday, Mar got some sympathy from the California Supreme Court. The court seemed to want to ensure that stun belts, like shackles and other protective measures, are used only when absolutely necessary and don’t violate a defendant’s right to trial without restraint. The court also appeared eager to figure out a way to do so under current case law, without formulating new tests of need.