_autocast can now be overridden globally with set_cast_func(func)