We present a conjecture generalizing the Cauchy formula for Macdonald polynomials. This conjecture encodes the mixed Hodge polynomials of the character varieties of representations of the fundamental group of a Riemann surface of genus g to GL_n(C) with fixed generic semi-simple conjugacy classes at k punctures. Using the character table of GL_n(F_q) we calculate the E-polynomial of these character varieties and confirm that it is as predicted by our main conjecture. Then, using the character table of gl_n(F_q), we calculate the E-polynomial of certain associated comet-shaped quiver varieties, the additive analogues of our character variety, and find that it is the pure part of our conjectured mixed Hodge polynomial. Finally, we observe that the pure part of our conjectured mixed Hodge polynomial also equals certain multiplicities in the tensor product of irreducible representations of GL_n(F_q). This implies a curious connection between the representation theory of GL_n(F_q) and Kac-Moody algebras associated with comet-shaped, typically wild, quivers.