Probably belongs in `pydantic-core`, but keeping this here for tracking purposes. This would allow support for more custom errors, ex: changing the error `loc` as requested in https://github.com/pydantic/pydantic/issues/8092.