yes, but the template has to know the type at compile time...
The trouble with this is all the guesswork.
12AB ... is it a string, or a hex number?
This sort of thing feels like a good way to make code slower and more convoluted generally. Strong types are good. Weak types are extremely difficult to work with... I spent years fighting a matlab over that, where a variable that was a string a min ago is now a double then its a matrix then its a loop counter and now its a string again...