  Galaxy clusters are a promising probe of late-time structure growth, but
constraints on cosmology from cluster abundances are currently limited by
systematics in their inferred masses. One unmitigated systematic effect in
weak-lensing mass inference is ignoring the presence of baryons and treating
the entire cluster as a dark matter halo. In this work we present a new
flexible model for cluster densities that captures both the baryonic and dark
matter profiles, a new general technique for calculating the lensing signal of
an arbitrary density profile, and a methodology for stacking those lensing
signal to appropriately model stacked weak-lensing measurements of galaxy
cluster catalogues. We test this model on 1400 simulated clusters. Similarly to
previous studies, we find that a dark matter-only model overestimates the
average mass by $7.5\%$, but including our baryonic term reduces that to
$0.7\%$. Additionally, to mitigate the computational complexity of our model,
we construct an emulator (surrogate model) which accurately interpolates our
model for parameter inference, while being much faster to use than the raw
model. We also provide an open-source software framework for our model and
emulator, called maszcal, which will serve as a platform for continued efforts
to improve these mass-calibration techniques. In this work, we detail our
model, the construction of the emulator, and the tests which we used to
validate that our model does mitigate bias. Lastly, we describe tests of the
emulator's accuracy
