Fix Issue 10931 - etc.c.zlib is missing proper const annotations for parameters and uses C-style pointer declarations.
Merge pull request #2123 from AndrejMitrovic/Fix10931

Issue 10931 - etc.c.zlib is missing proper const annotations for parameters and uses C-style pointers
Re-implement reduce.
Tweak reduce impl for 12569
Yet more reimplementation