From Perl, you can use Devel::Peek or B to inspect SVs with magic attached. But for most uses, the only way to access an SV magic is through the C API.
Are you trying to do something specific or just investigating about the matter?
Both actually. I'm curious if that be possible to somehow label each scalar a subroutine sees without storing the label in a separate hash, but on the scalar itself, using magic. Even if there is a non-magic way of doing that (which very well might be, I just doubt that), I'd be anyway interested in a common magic framework.