Here's a trick that I've learned that may help everyone out (credit to frogbeastegg for this): For any faction that can reach the huge city level, only let the positive population growth factor in the settlement details scroll reach 8%. Once the city reaches a population of about 24000, the squalor level will cancel out the positive growth to 0%.

For some cities, it's nearly impossible to do this (Patavium, Carthage, Alexandria) because of their ridiculously high natural grain amounts. To limit this, don't build any farms in those cities.