Congratulations on discovering XKCD 538 [1]. Depending on your exact threat model (i.e. barring a very surprise attack), this actually can be defended against in many cases, too.
Is there a way to do [2] on Android? I know you can hold the power button and choose Lockdown, but that requires actually looking at the phone, which would be difficult in some situations.
I haven't used an Android phone for more than about 5 minutes in total ever so perhaps someone more informed in that ecosystem can weigh in, but a quick Google did not find a way. It's also worth checking that the same properties of "before first unlock" hold for Android as they do for iPhones even if you can reset it in such a way.
[1]: https://xkcd.com/538/
[2]: https://daringfireball.net/2022/06/require_a_passcode_to_unl...