fn get_or_insert<T: IDLike>(id: T, set: &mut IndexSet<T>) -> T
Get the specified ID in set, if present, inserting it if not.
set
By returning an existing ID, we can avoid having extra copies.