The definition was leaking into ansible.module_utils.basic and causing type checking to fail when running module as script. Not entirely clear why this should be the case.