# Can I make a “deep copy” of a macro? [duplicate]

This question already has an answer here:

I would like to make a deep copy of macro that I don't have control of, because various packages might change it. So I want to take the current meaning of the macro, patching it, but without changing the original macro. Something along the lines of

\deepcopy\mylabel\label
\patchcmd{\mylabel}{\thepage}{\thepage+1}{}{}

How can I achieve that?

-