A collection of two relays, two diodes, one resistor and a toggle switch to safely power down the RaspPi.

NB. R2 must have a 3.3V coil capable of switching with about 5mA. R1 must be suitable to whatever you are switching.

You should also have reverse-biased diodes in parallel with each relay coil, 1N4001 would probably be good. The lines on the case should be on the side away from GND. A resistor in series with GPIO A is also probably a good idea. 1k would probably be suitable.