

I think you’re confused. The court already has the ability to force testimony, and witnesses can already be thrown in jail for refusing to testify.
I updated the title to make it clear that I’m referring to penalties that already exist, rather than suggesting that new penalties should be created.
It’s a multi-edged sword. It also means someone could be forced to testify against a friend or loved one, and in a slightly removed example, my beliefs also apply to laws that allow individuals to be imprisoned for failing to provide a password to locked electronics, regardless of whether or not they actually remember it.
Maybe it would be a good middle ground to instead expand the privileges that allow members of a marriage to avoid testifying against one another, to include friends and family. The same reasoning applies, except that the state believes it can determine the strength and meaning of a relationship by its title and type alone.