... suggests wiring the button as a pull-down, which could short the power to ground through the input pin if someone happened to run code with a pinMode(2,OUTPUT)
I've seen this diagram several times, but I've lost track of the source:
No, the resistor prevents a short to ground but you an get a short to 5V, which is just as bad. With a pull-up resistor, you can get a short to ground. The moral is - Don't mix-up inputs & outputs!
The advantage to pull-ups is that there is a built-in pull-up that you can enable.
The external resistor does not prevent shorting 5V to ground directly thorugh a digital LOW pin, bypassing the resistor.
I agree it is indeed bad if you mix up the inputs and outputs, but if the only source of 5V is the pinMode(pin,OUTPUT) and you short that to ground when you press the button, it might be somewhat less damaging that trying to sink the full power supply into the LOW output pin.
For a deployment, @LarryD's 5V on a long wire failure mode seems much more likely than my malicious code failure mode.