Well, you can always pick a few of the above, but just have them as a smaller factor. To me, I think something like:
cost = 60 + 10 * (number of that district type in your empire) + 5 * (total number of districts in your empire) + 15 * (number of other districts in the city) + (some modifier per era?) (all numbers can be tweaked to balance)
As long as you have 0 production in a district, cost gets recalculated. If > 0 production, then you lose a certain amount per turn (to prevent locking, putting 1 turn of production, and then building something else). But really, no matter what system you have there will be some way to "game" it and optimize, as long as it's not that powerful a tactic I don't mind too much.
This way, you get a penalty for going tall, a penalty for going wide, and a penalty for building too many of the same type of district (so that maybe you get to a point where it's not actually worth it to build yet another commercial hub). Yeah, it would penalize you for building a holy site in every city if you want the religious win, but then again, I don't really see that as a problem - maybe it costs 25% more than another district, but that's not really any different than the current penalty/bonus that they have.
Combined with other changes (maybe take the trader spots away from districts and have them scale by another mechanism, or at least have the internal trade route bonus not be as strong), this would make more sense, and at least would seem to be a more consistent system with us already used to other things like settlers and builders increasing cost based on the number produced. And it at least wouldn't "penalize" you for building a campus early.