Can you "withdraw your application to enter" in the United States without a permanent black mark on your record, even on air travel?

In my opinion, thanks to uncomfortably lax privacy laws in the US. In the USA, immigration officials may require that you allow them to search your phone. If you have fingerprint unlocking, they can force it directly, but if it's an access code, you can reject it. Naturally, if you refuse, they probably won't admit you. Is it possible to return without having a permanent black mark on your record? E.g. Pay your own plane tickets and go home without a technically refusal there? Or will you have to accept your phone search if you want any chance of returning to the United States (or even any of the other five eyes)?