Ok I just found this post that suggests using a checkout UI extension to remove the discount via useApplyDiscountCodeChange hook c.f. https://community.shopify.com/c/extensions/is-it-it-possible-to-remove-discount-codes-from-a-cart-using/td-p/2193014.
That seems doable, but if it is possible via the functions or elsewhere, I would prefer that over the checkout UI extension - anybody knows another way to do it?