Hi James,
The problem is a little obscure, but seems to occur in minimalist functions without local variables, such as these. It is fixed by creating a local variable in the function (any will do), or use an explicit str(..) in the return expression. I will investigate further to pinpoint the cause.
% filename "t.exe"
uses rtl64
'FUNCTION OVERLOADING
'====================
function foo (long v) as string
return "long " str(v)
end function
function foo (double v) as string
return "double " str(v)
end function
function foo (string v) as string
return "string " str(v)
end function
long l=42
double d=42.5
string s="43"
print foo l
print foo d
print foo s