What were you working on that cost a billion dollars to rewrite? Or was that hyperbole?
Real numbers. I can't say what directly, but you can make a good guess if you read my comment history. (I don't think this would be worth your time, but you could)
I'd say you only pay 10% of the cost when you finish/launch the re-written software. The other 90% of cost comes later in the format of operations, deprecation and migration, people both users and devs, community friction and learning cost.
And that 90% could be an underestimate here.