Those are fairly cheap, hyperscalers have been building more or less their own cables for many years, they cost practically nothing compared to the data centers themselves.
The vast, vast majority of submarine cable projects are paid for with private money. I'm only aware of a few in the US that have received any public grants (all connecting relatively unprofitable areas like Hawaii, kind of analogous to the Essential Air Service program).
https://resources.telegeography.com/telegeography-content-pr...