Fixed 20368 -- Make TECHNICAL_500 more resilient.

This limits large variables and non-utf-8 in the TECHNICAL_500 output.