layout: Implement out-of-line template method as a non-template.
Template functions need to be defined inline or have all the expected
instantiations specified in the header.
With only three instantations (and ostreams leading to significant code
being generated due to the huge number of lookups for operator<< overloads),
it's probably easiest to define overloads that call a templated static
out-of-line.
Discovered by building with thinlto, which more strictly applies C++ rules on
such things.
PiperOrigin-RevId: 784324779