They wouldn't specifically subpoena your password. A subpoena could be issued to you and you could be required to testify about things and potentially one of the questions could be to divulge your password. Now the fifth amendment protects against self-incrimination so your best bet is to simply not answer anything and invoke the fifth. Because that protects you from testifying to things that could incriminate you, and not just those things that will incriminate you. Of course once they have the password you never know what someone might find which is why you should take the fifth and not testify to anything.
Courts can legally get around your fifth amendment protection and compel you to provide the password and access but in doing so they must also grant you immunity against anything they may find. The courts have upheld that your testimony no longer can incriminate you so you can be held to testify accurately. If you do not you would be in contempt of the court. Generally in this situation they have an idea of the data or information that they want and you are a small fish and they are going after someone much bigger.
The other similar scenario would be instead of a subpoena for your testimony they would get a warrant to search your system. This is where it gets kind of interesting because when they have a valid warrant they are allowed entry into the device but they are still not allowed to force you to testify against yourself as in divulging a password. They can attempt to crack the password but they cannot force you to tell them what it is. On the other hand if you are using a form of biometric security because that is not considered testimony they can force you to use your fingerprint or face scan or other biometrics to open it up. This is a very important distinction when you're considering the security of your data especially against law enforcement searches.
https://www.eff.org/deeplinks/2023/05/federal-judge-makes-hi...
The courts generally side with the people that open ended searches without any kind of suspicion are not constitutional. Of course that does not stop the government from doing it and waiting for the courts to rule in every specific scenario. Because we have a strange system where we have officials that are sworn to uphold the constitution but they're not required to seek clarity before implementing a policy that could violate it. They have no repercussions for violating it the first time. Which generally means that violated it thousands of times until they hit the one person with the money to challenge them.
Also at the border US citizens are different than non US citizens in what their requirements are. For example a US citizen cannot be denied entry because they do not want to cooperate with a border investigation. The border patrol will tell you they can deny you entry but that is completely false. They can hold the suspicious items but they cannot hold you as a person and block your entry if you can establish your US citizen usually with your passport. This includes failing to disclose a password to your electronic device they can hold the device but they cannot hold you.
If you are not a US citizen they can deny you entry for any reason at all even if you have a valid visa.
My best suggestion for anyone who is concerned about electronic device searches is back up the device when you're outside the country, wipe it, Transit the border and let them do a search on a device that has nothing and then restore the device when you're on the other side. Because this whole charade about meeting to search an electronic device for electronic contraband is idiotic what I can simply send it through the internet ether around every access control.
What you can't do is send it through the internet without them seeing it. They may not block it. They may not "confiscate" it. But they still get the intel from it.
At least, I assume they do. I think most of us assume that.
Edit: why downvote? I'm generally curious about how they handle immunity with multiple levels of overlaping jurisdiction for most crimes.
The only thing they can not force you to is remembering.
Can be many reasons not to remember things. Injuries, age anything.
It’s a common politician practice to not remember.