py: Factor out impl of special methods for builtin types into opmethods.c