Context. The number of known strong gravitational lenses is expected to grow substantially in the next few years. The combination of large samples of lenses has the potential to provide strong constraints on the inner structure of galaxies. Aims: We investigate the extent to which we can calibrate stellar mass measurements and constrain the average dark matter density profile of galaxies by combining strong lensing data from thousands of lenses. Methods: We generated mock samples of axisymmetric lenses. We assume that, for each lens, we have measurements of two image positions of a strongly lensed background source, as well as magnification information from full surface brightness modelling, and a stellar-population-synthesis-based estimate of the lens stellar mass. We then fitted models describing the distribution of the stellar population synthesis mismatch parameter αsps (the ratio between the true stellar mass and the stellar-population-synthesis-based estimate) and the dark matter density profile of the population of lenses to an ensemble of 1000 mock lenses. Results: We obtain the average αsps, projected dark matter mass, and dark matter density slope with greater precision and accuracy compared with current constraints. A flexible model and knowledge of the lens detection efficiency as a function of image configuration are required in order to avoid a biased inference. Conclusions: Statistical strong lensing inferences from upcoming surveys provide a way to calibrate stellar mass measurements and to constrain the inner dark matter density profile of massive galaxies.