Not always possible; consider courthouses where one may be compelled by law to go and, even though he has committed no crime, disarmed. [Jury-duty; you can be fined/jailed for ignoring/refusing summons.]
Due to annoying family members I hit 3 court buildings in one day last week. To get into all of them involved emptying pockets and going through a metal detector, one of them I emptied my pockets into a locker and THEY kept the key. That’s how it works and if you don’t like it too bad. I’ve done jury duty in 2 of those buildings in the 90s, same drill back then. When the people in charge of a building decide it’s a security zone then it’s a security zone and you’re going to be searched to go in, and nobody has ever successfully challenged that as a rights violation.
Yup. I'm thinking next time I'm called down for jury duty I'm going to raise enough of a ruckus over their unconstitutional procedures, that I'll probably end up in jail. It's not like they are going to pick me for a jury, since I can read.