[python] generate static methods as real python static methods
Merge pull request #2944 from nadako/genpy_statics

[python] generate static methods as real python static methods (closes #2943)