def find_first_diff_pos(str1: str, str2: str) -> int:
    """Finds the first difference position. Returns `-1` if both strings are identical."""
    if str1 == str2:
        return -1

    shorter, longer = sorted((str1, str2), key=len)
    shorter_len = len(shorter)

    return next(
        (i for i in range(shorter_len) if shorter[i] != longer[i]),
        shorter_len,
    )