Speaking strictly from a musical perspective, I think 4-5 is the sweet spot. And I'll use the two groups that I think are the most impressive musically to illustrate why.
Red Velvet, 5 members. They have two very gifted vocalists (Wendy & Seulgi), two rappers (Irene & Yeri) and one swiss-army knife of awesomeness... Joy!
Blackpink, 4 members. Much like Red Velvet, they have specialists... they just don't have a jack-of-all-trades like Joy. Having two specializing in vocals and two specializing in rap is perfect. And they can also harmonize really well together.
I think when you go beyond 5, you start to have too many "sub-vocalists" and other roles that aren't really necessary from a musical perspective. When you have 4-5, you can split up the parts nice and evenly and you get to enjoy the voices of all the members as they have equal participation. This doesn't happen in a larger group like TWICE where the line distribution is far from equal.
However, there is a nice benefit to having a lot of sub-vocalists and that is, having a nice varietal sound with harmonies. The same effect that a choir has and at the end of the day, it's all a matter of preference. Some people love the larger groups and that's OK. Music is a very personal thing.
Those are my thoughts NOT YOURS...