Here is an alternative:
ClearAll[f];
SetAttributes[f, HoldAll];
f[a_Symbol] :=
Block[{$ContextPath = {"Test`"}, $Context = "Test`"},
ToString[Unevaluated@a]
];
It is based on the way Mathematica treats short and long names depending on the current settings of $Context
and $ContextPath
. The context "Test`"
must not exist for it to be fully bulletproof (it will produce short names for symbols in "Test`"
otherwise), you can use some random string for it. The function produces the same output as yours. You can make it Listable
as well, but for speed, it may be better to add a special rule for a list of symbols, so that the context is changed only once.