generator: Fix signature of static method overloads

For method with optional parameters, when generating the overload
without the optional parameters, mark the overload as static if the
original method is static.