Good choice. The only circumstances where it’s not a big risk to withhold your PIN is when you are a citizen entering your home country. Even then they can turn it into a pretty nasty time for you (as seen by the guy in the article, where they threaten to just keep his stuff).
Depends how much you want to visit the country in question. I will be bummed if I am blocked from visiting EU (I am US citizen) but any other country is kinda irrelevant. If Japan put me on no travel list, I would not care one bit.
There is inconvenience of being deported but frankly risk of giving access to all clouds account to random official is just too high.
There is also risk of them putting you in jail but I am not sure if unblocking phone really mitigate it.
All the deportations I’ve heard of where the person arrived by air, they were jailed until they could be put on a flight back. They only say “you can’t come in, now go away” if you’re crossing a border by land - and plenty of countries are going to refuse to let you walk away even then.