Doped strontium titanate SrTiO3 (STO) is one of the most dilute superconductors known today. The fact that superconductivity occurs at very low carrier concentrations is one of the two reasons that the pairing mechanism is not yet understood, the other being the role played by the proximity to a ferroelectric instability. In undoped STO, ferroelectric order can in fact be stabilized by substituting 16O with its heavier isotope 18O. We show that the superconducting Tc increases when the 18O concentration is increased. When approaching SrTi18O3 the maximum Tc occurs at much smaller carrier densities than for pure SrTi16O3. Our observations agree qualitatively with a scenario where superconducting pairing is mediated by fluctuations of the ferroelectric soft mode.