a magnet which can be turned off (but doesn't require power to stay on)

Maybe the simplest solution would be to use a permanent magnet and an electromagnet with an iron core: When the electromagnet is off, the iron core will be attracted to the permanent magnet, when you turn on the electromagnet, it will repel the permanent magnet. As a bonus, you could also reverse the voltage across the electromagnet to attract the permanent magnet, to keep it closed even harder.