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

You're describing an "Electropermanent Magnet". Google the "OpenGrab" and you'll have what you're looking for.