Change implementation of the --no-mem-cast flag

Merged Michael Sammler requested to merge ci/no_mem_cast into master

Merge request reports