Measurement of the prompt $\mathrm{D}^0$ cross section in pp collisions at $\sqrt{s} = 13.6\ \mathrm{TeV}$