This fixes T70269: ChildOf constraint 'Set Inverse' not working when targeting vertex group.
The old code relied on some DAG_id_tag_update(&ob->id, OB_RECALC_OB) call in UI code that was removed in rB4c2b79a1d5a63. Having constraint functionality rely on UI code seemed like a bad idea, so I reimplemented the 'Set Inverse' functionality.
The old code used BKE_object_workob_calc_parent() to do the heavy lifting. However, that function uses a 'cleaned copy' of the object, so it only has its matrix, a parent pointer, and the list of constraints. This would fail to take the target vertex group into account, as that cleaned copy did not have any mesh data whatsoever.
This new implementation uses depsgraph evaluation to obtain the world matrix before and after this constraint, and computes the inverse matrix from that. This could be slightly slower than before, as objects depending on the constrained object are also recalculated a few times, but I think this is a small price to pay for actually doing the correct thing.
An alternative approach could store the applied matrix as part of the constraint data, and invert that when the user presses the 'Set Inverse' button. As this would require more CPU ticks on every evaluation, rather than just on a button press, I rejected this alternative.