If you're in trouble with the law, you can (in some cases) get out of it by establishing mental incompetence.
Actually establishing mental incompetence can be the tricky bit, though given the exploits of most PCs it shouldn't be all that hard.
Transcript
Lando: Psst, Han. It's me, Lando. I saved you from Vader.
Han: Uh, from who?
Lando: I saved you so when we get out of here, you can face judgement for your alleged treachery to the Rebellion.
Han: Treachery? I think I'd remember if I did any of that.
Han: Last thing I remember I was introducing you to Bresenni Tonnika in the casino on Balfron.
Han: How'd that turn out, anyway?
Lando: You don't know the half of it.
Chewbacca: You can't put him on trial. He's not mentally competent.
Lando: There are degrees of this...