Change Case summary report to group by Case ID
In general this kind of thing depends what other fields you're including as columns. But ignoring that for the moment one approach is use the groupBy as you suggest and then in select() add an if statement for the contact sort_name and use mysql GROUP_CONCAT().

Another is remove the joins and anything related to contact.

Another is alter the from() to do some kind of derived table inner select on the contact tables so that at the outer level it's already flattened to one row per case.