The API is more general than Variant.new to allow a wider range of possible uses.
format_string must still point to a valid format string, but it only needs to be nul-terminated if endptr is NULL. If endptr is non-NULL then it is updated to point to the first character past the end of the format string.
Note that the arguments in app must be of the correct width for their types specified in format_string when collected into the va_list See the [GVariant varargs documentation][gvariant-varargs].
The return value will be floating if it was a newly created GVariant instance (for example, if the format string was "(ii)"). In the case that the format_string was '*', '?', 'r', or a format starting with '@' then the collected glib.Variant pointer will be returned unmodified, without adding any additional references.
In order to behave correctly in all cases it is necessary for the calling function to Variant.refSink the return result before returning control to the user that originally provided the pointer. At this point, the caller will have their own full reference to the result. This can also be done by adding the result to a container, or by passing it to another Variant.new call.