Switch on computer with microcontroller

My first reaction is to use a opto-coupler. That isolates your microcontroller from the PC ground, which is a good idea. This solution still requires that the device be installed with the correct polarity, which personally I don't think is a big deal.

I also don't think that worrying about the voltage being high makes any sense. The front panel button is going to be a logic level signal. However, the output of optos will be a bare transistor. Most can withstand 20 V at least, which will surely be enough.

If you really insist that the output should be polarity-independent, then use two optos with outputs wired opposite but in parallel:

Check the maximum allowed reverse bias voltage of whatever optos you use. These are good to 6 V, which will be fine for a PC power switch which isn't going to operate on more than 5 V logic, most likely less. This example puts about 10 mA thru the LEDs, and draws around a mA from the logic output. Nothing is being pushed to the limit here, and the output is polarity independent.