Yeah, you’d be generalizing faces together indiscriminately, there is no way to prioritize the vertices and faces that you want to keep with that code. So the result would have equally bad distributions of triangles, just a lower face/vertex count overall, but that doesn’t help you at all.
(Well it does reduce the counts, but it would also seriously deter the quality of the model.)