AFAIK similar laws exist in most industrialized countries but those kind of laws do not prevent your ex-wife (or your still wife but in the process of divorce) from testifying against you if she willingly wants to.
so then you do the math. is it worth it to tell your wife some secrets that you own bitcoin?

There has to be exceptions to that law, right? A psychologist is a doctor. They can't disclose the information you have confided to them. But if the information concerns someone's life, they are allowed to notify the authorities and probably to testify against you.
so here's the thing. what would you have to gain by telling a doctor or someone that you committed a crime? probably none right? so why do it?