var is bad anyway because it just overloads types, Studio probably does the same shit, and no matter which engine or programming language you use a variant data type is horrible, it's for people who don't know data types
With that in mind, var overloads std::string, but the problem you are having is that string(); is a function in GM, thus why it is telling you about the missing brackets. You can't use std::string either because our compiler blocks you from using that namespace until JDI can handle parsing all of STL.
Line 1, position 5 (absolute 4): Cannot handle :: with current parser configuration. Oops.