Allows taking ownership of a value from a mutable reference temporarily, replacing it with a default.