I know that a gas behaves more like an ideal gas at higher temperature, and that is very well achieved in the Sun's core. But also low pressure is needed for a gas to behave like an ideal gas, and the pressure at the Sun's core is very high. So now if I know correctly and accurately the temperature, density and pressure of the Sun and I want to calculate the average kinetic energy of a Hydrogen or a Helium ion at the center of the Sun's core, can I simply use the $\frac32kT$ law to calculate that ?
Also, if the electrons were degenerate, but I knew the temperature at different parts from a standard solar model (not by using ideal gas laws), can I still use $\frac32kT$ for the ions (not the electrons) ? Or will the electron degeneracy prevent me somehow ?