In the restricted environment, it is possible to know the number of members in a group by checking the existence of all the possible units with UnitExists(UnitID) or by using a SecureStateDriver with [@UnitID,exists] conditions. Unfortunately maintaining this information updated in the addon is a CPU hog.
Given these facts, I propose the addition of an equivalent of
GetNumGroupMembers() to the restricted enviroment, to reduce the CPU use of addons that need to know the group size in combat.