As a consultant had to work in some insane open office environments, including ones where the sales people are on the phone constantly, well within earshot of the engineering team. I used in ear monitors with aftermarket foam tips. Very effective. I also had the experience of a client CEO, and the director reports, standing behind me, and one more junior person tasked with waving their hand in front of my face to get my attention.
So much this. Humans are inherently social animals, and if you look like you’re focused and working, most people will respect that. The headphones are also an immediate signal that you’d prefer to be left alone. In my experience, only people facing a rather serious and pressing problem will interrupt you in that situation, “hey sorry to bother you, but X just went offline without an alert”
No one comes near me unless absolutely necessary