def string_to_bytes(value: str) ->bytes:
    """Converts a kOS STRING or STRING_VALUE into a bytes object"""
    len_bytes = bytes([len(value)])
    str_bytes = value.encode('UTF-8')
    return len_bytes + str_bytes
