But the problem with this logic is that comparing two people is NEVER the same. The fact is that one person's PhD thesis, research, talks, etc. is always differnt from another's so holding such a hypothetical is illogical. Obviously, if you really do hold all things static, then a higher GPA would be better to an extent. After a lot of reading, it seems that GPA acts more as a "check-mark", where it's only necessary for certain fundings or to make sure that you didn't completely throw away your coursework. Depending on the field, as long as you don't get below X, then I'm sure it hardly makes a difference.
But you should never neglect your courses for the minimal grades. You take courses to help your research/interests, and if you just barely get through your classes, what's the point of even taking the classes?