code: def strip_codes(s: Union[str, 'ChainedBase']) -> str:
      
      return codepat.sub('', str(s) if (s or (s == 0)) else '')
docs: Strip all color codes from a string.
          Returns empty string for "falsey" inputs (except 0).