I'd probably just do something like:

    # %ae prints the authored_by email for the commit
    # %n prints a newline
    # %ce prints the committed_by email for the commit
    return set(git.log(from_commit, to_commit, format='%ae%n%ce').splitlines())