def force2bytes(s):
    """
    Convert the given string to bytes by encoding it.

    If the given argument is not a string (already bytes?), then return it verbatim.

    :param s: Data to encode in bytes, or any other object.
    :return: Bytes-encoded variant of the string, or the given argument verbatim.
    """
    if isinstance(s, str):
        return s.encode()
    else:
        return s