Actually, I'm not sure they can compel non-citizens. If you want in, you might have to give them the keys. But if you would rather not enter, would they compel on pain of imprisonment?
UK citizen here and I've never had any issue with flying in/out of UK with several electronic devices (phone, laptop, tablet, steamdeck etc). Never even been asked to power them on or demonstrate them working (i.e. to show that they're not a bomb disguised as a laptop) and don't know anyone else that's had any hassle getting back in the country. I've been selected for being swabbed for explosives a few times though, but even that only takes a minute and is hardly any inconvenience.
In my experience, Australia was the most difficult country to get into as they are (now) very careful about bringing in any plant seeds or fruit, but the security staff were very friendly and helpful. I had to spend a while explaining that I did have some bananas in my bag previously which was why the cute sniffer dog was interested in it.
Your personal experience is probably representative in that invasive searches happen to very few people, but that's not the issue at hand. The fact remains that the British will imprison you for refusing to decrypt your stuff (or for refusing to answer their questions):
Australia is annoying. Israel is by far the worst- UK is bad in theory since they can jail you to compel an unlock, but obviously is going to happen to a vanishingly small number of peopleā¦
In my experience going through the border in China is more pleasant than through the USA, never had a hiccup in China while I've been detained for hours without contact with the outside going through a transit in JFK.
The vast majority of people from the developed world have no problems going through any border in the developed world. Your experience is probably representative, but that's not what we're talking about. My understanding is that de facto you have no rights at all in China. The Americans take this sort of thing very seriously, which is why it's in the news and talked about. Some guy gets imprisoned for 37 days for a meme (and is subsequently paid $835k by gov't for his trouble) and it's all Greg Lukianoff can talk about. [0]
Yet Japan, a country the West fetishizes regularly, routinely jails people for 20 days with no contact or even any charges at all, often ruining their lives, while desperately trying to force a confession no matter how innocent you are, then (hopefully) turning them loose, and not many people seem to care about that.
In my experience, Australia was the most difficult country to get into as they are (now) very careful about bringing in any plant seeds or fruit, but the security staff were very friendly and helpful. I had to spend a while explaining that I did have some bananas in my bag previously which was why the cute sniffer dog was interested in it.