What would be the ideal world population?

100 billion sounds like a good number. Still plenty of room for nature, while having far more technological, industrial, and cultural capacity.

Obviously we can’t do it the way we’re handling the current state of affairs. We’ll need a wholesale switch to sustainable industry. Hopefully, some of that industry will be off-planet. Even if we can’t import material resources, we can at least import energy.

A trillion people would probably be a bit much. We don’t want to live on Trantor or Coruscant. I guess we’ll want off-world colonies eventually.