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

What about using a regular permanent magnet and a servo to withdraw it far enough not to have any effect?

...R