user_defined_type - add tests from the Python patch for
TestTypeFunctionCallOnlyOnce