def METHOD_NAME(bin):
  if type(bin) == type(bytes()):
    try:
      return bytes.decode(bin, encoding='utf-8', errors='strict')
    except:
      pass
    # we want a hexdump in \xNN notation. bin.hex only takes a single char, so we replace that later.
    return "\\x" + bin.hex(':').replace(':', "\\x")
  return "ERROR: unknown type in bin_dumper(): " + str(type(bin))