Context : Near a dozen star-forming galaxies have been detected in \gamma rays by the Fermi observatory in the last decade . A remarkable property of this sample is the quasi-linear relation between the \gamma -ray luminosity and the star formation rate , obtained assuming that the latter is well traced by the infra-red luminosity of the galaxies . The non-linearity of this relation has not been fully explained yet . Aims : We aim at determining the biases derived from the use of the infra-red luminosity as a proxy for the star formation rate , and shed light onto the more fundamental relation between the latter and the \gamma -ray luminosity . We expect to quantify and explain some trends observed in this relation . Methods : We compile from the literature a near-homogeneous set of distances , ultraviolet , optical , infra-red , and \gamma -ray fluxes for all known \gamma -ray emitting star-forming galaxies . From these data we compute the infra-red and \gamma -ray luminosities , and star formation rates . We determine the best-fitting relation between the latter two , and describe the trend using simple , population-oriented models for cosmic-ray transport and cooling . Results : We find that the \gamma -ray luminosity–star formation rate relation obtained from infra-red luminosities is biased to shallower slopes . The actual relation is steeper than previous estimates , having a power-law index of 1.35 \pm 0.05 , in contrast to 1.23 \pm 0.06 . Conclusions : The unbiased \gamma -ray luminosity–star formation rate relation can be explained at high star formation rates by assuming that the cosmic ray cooling region is kiloparsec-sized , and pervaded by mild to fast winds . Combined with previous results about the scaling of wind velocity with star formation rate , our work provides support to advection as the dominant cosmic ray escape mechanism in low-star formation rate galaxies .