>Would $20B/year allow SpaceX to build bases on the Moon and Mars?

I don't see why not.

>That makes the total Apollo Program cost $163 billion inflation adjusted to 2008. [1]

Zubrin said in 2012 that if given to NASA Mars Direct would cost 30-50 billion but a private company could do it for around 5bn. That's for 6 manned flights to Mars over 10 years. Let's be overly paranoid and make some much broader assumptions.

If SpaceX could spend 40 billion over 10 year sand six 6 manned flights, and 6 supply flights via ITS/BFR/Starship /Muskship/whatever it's going by at the time of this comment you could absolutely build a decent semi-permanent structure as well as test, on Mars, creating in-situ building materials.

If you found a viable way to make structural bricks from regolith, you could develop automated earth moving machinery that could be updated and 'controlled' (not unlike a rover) to just churn out bricks between missions which could be used for bunker/vault construction to act as surface shielding and for just acting as a barrier for limiting exposure to dust storms as well.

---

Take the moon, the moon would be much cheaper to build a semi-permanent/permanent base on. First, supplying it with materials is going to be cheaper and quicker, communication delays are going to incredibly smaller which means higher bandwidth. Transit times are orders of magnitude shorter so you can adapt structures/hardware with more generations and modify more on the fly.

First step I'd just live on the craft for short periods before returning. Get some sort of regolith-moving machinery and simply create some flat areas and/or trenches. Try and process the regolith into bricks again with automated machinery, using the long lunar days for the energy to process the regolith and shutting down for the long lunar night. Then you just build vaults from the bricks, pop in something along the lines of the Bigelow inflatable modules that are then protected by the vaults for the first semi-permanent structures and work on a more rugged construction as you collect lots of data and experience.

While you're doing all of that you're working on energy storage for getting through the long lunar nights and building out your PV array for the long lunar day.

The expensive part is going to be the development of the machinery (including the rocket and manned spacecraft). If they lifted a tunnel boring machine in pieces and developed some sort of earth/regolith-moving space-CAT and a brick manufacturing operation (collect regolith, sort the smallest particle size stuff out for smelting/compaction/some sort of 'concrete' use) and start making rubble piles of larger rocks that could possibly be used via traditional stone carving/masonry techniques and you can get into the construction and material business too and hire that all out to companies/countries to create another revenue stream not to mention license any technologies developed to traditional companies like Caterpillar for use developing their own Mars/Moon machinery.

---

You'd also send a lot of satellites to Mars and the Moon for use as communication relays, really you could even put some in various positions between the Earth and Martian orbits so that you have relays for when the sun is between them and to also keep your bandwidth up with the power demands of any given satellite down and you could rent usage on the network out to whoever.

You could also sell excess power to anyone that lands near your site(s):

"We will have this much power available during this time period during our brick-oven maintenance, pricing is at x per kWh"

Hey Bob, SpaceX has decent rates starting in a few hours, we could go ahead run an extra cycle of thing with our widget or top off the batteries in everything so we can run 2 more days of projects before night. What's the budget looking like for this cycle?

---

I think once you have the rockets, even 2 billion a year lets you start to do a lot of tinkering, especially if you start with the moon.

[1] https://christopherrcooper.com/blog/apollo-program-cost-retu...