Using the IRAM 30-m telescope, CN and CO isotopologues have been measured toward the central regions of the nearby starburst galaxy NGC253 and the prototypical ultraluminous infrared galaxy Mrk231. In NGC253, the 12C/13C ratio is 40+-10. Assuming that the ratio also holds for the CO emitting gas, this yields 16O/18O = 145+-36 and 16O/17O = 1290+-365 and a 32S/34S ratio close to that measured for the local interstellar medium (20-25). No indication for vibrationally excited CN is found. Peak line intensity ratios between NGC253 and Mrk231 are ~100 for 12C16O and 12C18O J=1-0, while the ratio for 13C16O J=1-0 is ~250. This and similar 13CO and C18O line intensities in the J=1-0 and 2-1 transitions of Mrk231 suggest 12C/13C ~ 100 and 16O/18O ~ 100, in agreement with values obtained for the less evolved ultraluminous merger Arp220. Also accounting for other extragalactic data, 12C/13C ratios appear to vary over a full order of magnitude, from >100 in ultraluminous high redshift galaxies to ~100 in more local such galaxies to ~40 in weaker starbursts not undergoing a large scale merger to 25 in the Central Molecular Zone of the Milky Way. With 12C being predominantly synthesized in massive stars, while 13C is mostly ejected by longer lived lower mass stars at later times, this is qualitatively consistent with our results of decreasing carbon isotope ratios with time and rising metallicity. It is emphasized, however, that both infall of poorly processed material, initiating a nuclear starburst, as well as the ejecta from newly formed massive stars (in particular in case of a top-heavy stellar initial mass function) can raise the carbon isotope ratio for a limited amount of time.