def str2bool(value: str) -> bool:
    """
    Convert a string representation of truth to true (1) or false (0).
    """
    # Check for truthy values (case-insensitive)
    if value.lower() in ('yes', 'true', 't', '1'):
        return True
    # Check for falsy values (case-insensitive)
    elif value.lower() in ('no', 'false', 'f', '0'):
        return False
    else:
        # Raise error for invalid values
        raise ValueError(f"Invalid truth value: {value}")
