it's not because of duplicates (see querying using pk).  it's just there to speed up the filtering of to_list.
optouts is already a subset of the emails in to_list, and won't have duplicates since we're using pk to query also User.email and (Optout.user, Optout.course) have to be unique.  So num_optout is accurate since each of its members will be stricken from to_list.

but we can change it to use len(set) just to be consistent.