Delete a variable?

How do I delete a variable after I am done using it?
I’ve created a variable in one function:
m.foo = “bar”

Then in a different function, I’d like to delete it since I no longer need it and wish for the variable to no longer take up any more memory space. How can I do this?

assigning invalid to it will do (think NULL, nil, None)

m.foo = invalid

and so will explicitly removing it from the dictionary

m.foo.delete("foo")