def validate_password(password):
    """Validate and reformat password argument.

    Args:
        password (str or bytes): Encryption password.

    Returns:
        str or bytes: The original password string.

    """
    if password is None:
        password = ''
    if not isinstance(password, str) and not isinstance(password, bytes):
        raise TypeError('Invalid password type')
    return password
