In Wikipedia there is this engineering definition of heat capacity
The heat capacity of an object, denoted by C, is the limit $$ C=\lim_{\Delta T\rightarrow 0}\frac{\Delta Q}{\Delta T}$$
I'm very uncomfortable with this poor definition for a long time now. I want a rigorous definition purely based on statistical physics, which doesn't use the term heat or at least gives a satisfying definition of heat based on quantum statistics beforehand. I also don't want to use any of the thermodynamic laws. The definition should naturally lead to the often used expressions $$C(N,V,T)=\frac{\partial U(N,V,T)}{\partial T}$$
$$C(N,p,T)=\frac{\partial H(N,p,T)}{\partial T}$$