Headphones, and a reflexive action to punch anyone who touches you when you have your headphones on is a very good way to dissuade people from distracting you and pulling you into meetings.
Doing this (well not punching people, just saying "not now" and putting the music back on :)) I think it works because there is such a need for programmers. Otherwise, I would probably come across as a candidate with terrible communication skills.
I like this idea -- headphones on, head down; get into the habit of having extreme reactions to people tapping on your shoulder by flailing around and acting super surprised they were there. Should hopefully keep the random drop-ins to a minimum.
source: I do this :P