  Measurements demonstrate the existence of compact stars with masses in a
broad range from 1.2 to 2 $M_\odot$. The most massive of these objects might be
hybrid stars. To fulfill the constraint $M_{\rm max}>2~M_{\odot}$ with a
reserve we exploit the stiff DD2 hadronic equation of state (EoS) without and
with excluded volume (DD2vex) correction, which produce maximum neutron star
masses of $M_{\rm max} = 2.43~M_{\odot}$ and $2.70~M_{\odot}$, respectively. We
show that the stiffness of the EoS does not preclude an explanation of the
whole set of cooling data within "nuclear medium cooling" scenario for compact
stars by a variation of the star masses. We select appropriate proton gap
profiles from those exploited in the literature and allow for a variation of
the effective pion gap controlling the efficiency of the medium modified Urca
process. However, we suppress the possibility of pion condensation. In general,
the stiffer the EoS the steeper a decrease with density of the effective pion
gap is required. Results are compared with previously obtained ones for the HDD
EoS for which $M_{\rm max} =2.06~M_{\odot}$. The cooling of the compact star in
the supernova remnant Cassiopeia A (Cas A) is explained mainly by an efficient
medium modified Urca process. With the DD2vex EoS and using an effective pion
gap steeper decreasing with the density and/or a proton gap shifted to smaller
densities we are also able to reproduce both a strong decline compatible with
ACIS-S data and HRC-S instrument data. The mass of Cas A is estimated as $1.6 -
1.9~M_{\odot}$, above the value $1.5~M_{\odot}$, which we have evaluated with
the softer HDD equation of state. Different mass choices for the hottest object
XMMU J173203.3-344518 are discussed. We make general remarks also on hybrid
star cooling and on its dependence on the stiffness of the hadronic EoS.
