Feature request: Limited variable scope

Is there a way to create a macro that deletes all variables?

Magic is usually best avoided with deletion – in this case you get the most control by deleting variables manually from the list in Keyboard Maestro > Preferences > Variables

But if you want to consider middle ground between control and power you could always script it with a 'keep list':

See Deleting (some) Keyboard Maestro variables – protecting others