The following code triggers a TypeError.
from unittest.mock import call
from pydantic_core import to_jsonable_python
# TypeError: '_Call' object cannot be converted to 'SchemaSerializer'
to_jsonable_python(call(1, 2, 3), fallback=lambda call: call.args)
We usually try very hard to avoid raising errors from serialization, this is also on a type inference pathway. I think it'd be reasonable to just hit fallback if the __pydantic_serializer__ attribute is invalid (this is the root cause of the TypeError).