This PR is a prerequisite for #34448. It was split into a separate PR to limit the scope and minimize potential merge conflicts.
The first commit improves the accuracy of IWYU suggestions within our heavily templated code. Note that, for now, the serialize.h header itself is excluded from IWYU inspection because it lacks a corresponding source file.
The remaining commits follow the Developer Notes guidance:
Use
IWYU pragma: exportvery sparingly, as this enforces transitive inclusion of headers and undermines the specific purpose of IWYU.