HPCC-12408 Various code generator optimizations

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Yes.  It is only a sanity check to check no-one has coded a class in a way we didn't expect.   We don't want the overhead in a release build.