I think it would cost an eye watering amount because the monarchy is, in one way or another, bound up in so much in this country: the judiciary, land management and ownership, political process, the military, currency, the postal system, the commonwealth, charities, heritage assets and art, huge portfolios of property, religion - the list’s endless.
Disentangling it would be a gargantuan task. It would involve setting up a new department to oversee it and recruiting hundreds of civil servants. Doubtless the big four management consultancies would take a chunk too. It would take decades, if not centuries, to recoup the costs.