One thing to keep in mind is that AC only reaches its peak voltage twice during the AC cycle. DC on the other hand is always running at peak. AC wiring, insulated standoffs, etc. all has to be designed to handle the peak voltage, which means that for the same wire, you can always transmit more power using DC.
However, there is an increased cost in transformers and switch gear. An AC transformer is just a coil of wire around a hunk of iron. Simple. The lack of a decent DC transformer is what stopped Edison in his tracks. These days we have DC transformers, but they aren’t as simple as a coil of wire. At some point you also have to convert the DC back to AC, which also involves a cost.
Also, disconnecting a high voltage wire isn’t as easy as you might think. The electricity tends to arc across the gap. With AC, the fact that the electricity crosses zero twice per cycle allows the arc to be fairly easily extinguished. DC will draw a much longer arc, requiring different (and more expensive) equipment to handle this.
The extra cost of the switch gear and transformers/inverters gets balanced out with the cheaper cost of wire. Below a certain distance, AC will always be cheaper. At longer distances, DC is cheaper.