It's been a while since I looked at one, but the schematics for the various Arduinos are open source, and they will show you how multiple alternate supplies are handled without any mechanical switching. But it may be that your LDO would be ok. Essentially they operate by regulating the amount of source current needed to maintain the designated output voltage. But there is rarely anything in them that would actively pull down the output. So if the actual output voltage stays higher than the target output voltage, the LDO would just turn its pass transistor completely off and pretty much shut down. But at some higher voltage it would damage the LDO, and the datasheet is your best guide on that. Also, I suggest you actually measure the current that flows backwards through the LDO output during the charging setup. If it's just a few milliamps, it's probably not a problem - again, subject to the Absolute Maximums in the datasheet. But the LDO could have a reverse biased diode across it, which would protect the LDO, but pass lots of current.
You can prevent any current flow by inserting a diode in the output line of the LDO. But a more elegant way, with almost no voltage drop, is to put a P-channel mosfet there, oriented so that its body diode is forward biased from output to the processor's Vcc. The gate would have a high-value pull-down resistor to ground, but would also be connected to the programmer power supply input. Normally the MOSFET would be fully on, but when the programmer is connected and that voltage comes up, voltage on the gate would go high, which would turn the MOSFET off. Kinda like reverse polarity protection for a battery-powered device.
So Google for the datasheet for something like the Uno, or whichever one allows for USB power or external barrel connector power, and there may be a third option - battery or something. Based on the last time I looked, it's all pretty clevee the way they do it.