Without having spent much thought on it, I'd say you can probably cobble something like that together with Attribute::Handlers and one of the many sub wrapping modules such as Hook::WrapSub, though I'm not sure the idea is good in the first place. I may come back to post some code and/or further arguments after dinner. :)
You've just pointed me to two modules (or even families of modules) I knew nothing about... They seem incredibly powerfull and can definitely achieve the sort of thing I was looking for...