I know it would be really expensive in the short term, but has anyone actually went and figured out if it would be a good investment, even if it was something as simple as a gas line for orbital refueling.
This page used some very generous assumptions to arrive at an estimate of 40 billion USD, though this was assuming 7 shuttle launches costing 3.7 billion: that part of the estimate would be lower now due to the lower costs of more modern launch vehicles.
This presupposes that carbon nanotubes (currently manufactured in centimetre lengths) can be fabricated into a 35,786 kilometre long cable without too much additional mass from things like glue. The exact properties of the elevator material matter, since quite small changes make things impossible. The linked graphs shows that at a strength of 100 MPa/kg, a space elevator is a ribbon a couple of cm across and microns thick. If the losses due to other materials drop that to 10MPa/kg, the elevator would literally end up being bigger than Earth. Single carbon nanotubes can be above 100 MPa/kg in strength, but the linked paper indicated assembled strands at between 22 and 3.6 MPa/kg.
This makes cost estimating difficult, since very very minor changes in construction details (a 1mm protective coating would be 2000 tonnes of paint alone) produce logarithmic changes in cross section of the top end of the elevator and overall system mass. This can easily move a space elevator from being 'a couple of Falcon heavies do it' to 'produces it's own tides'.