The district cost modifier works in favour of more cities, not against: the cities you do have can’t build districts cheaply, but more population (helped by having more cities) gives you some of the advantages districts can offer such as more science, culture, gold etc.
The district cost modifier is based primarily on the number of techs and civics you have finished. There is also a discount available if you have lots of districts completed but few placed of a given type. There’s no comparison to other civs.
Nonetheless, the modifier renders districts quickly extremely expensive. However it’s exactly the same modifier as used for the value of harvesting resources and forests, so you can reliably chop out districts at the same effective cost throughout the game. That does bring into focus one of the main drawbacks of the Civ VI economy: chopping forests provides way more production than cities can. So a freshly founded city with lots of forests to chop can produce an army faster than several established cities.
Techs do not scale in cost with the number of cities placed, that’s a Civ V thing only.
The primary mechanic that actually limits city spamming is that the cost of settlers increases with each one you build. At default speed it’s 80 cogs for the first one, 110 for the second, 30 more for each thereafter. Pretty severely limits how quickly you can build them in the early game. The negative effect of this is that it just makes conquest (or capturing settlers) all the more powerful: you get the cities without the cost increase.
The other reason not to spam cities early on is the opportunity cost in not doing everything else. In particular there are quite a few tech and civic boosts that you will miss if devoting your civ to building settlers.