Headless decouples the storefront. Checkout, admin and data stay on Shopify either way. The real cost is not the build, it is the front-end engineer you now need available every week....
If you run Magento Open Source 2.4.5 or 2.4.6 you are already unsupported. Adobe own lifecycle dates, what breaks when you move platform, and the four things that decide the build cost....