Why would you want to do that? There's really no such thing as too many units. Sure maintenance can be a killer, but in that case you should've gone to war long ago
If you don't want units, build buildings. Even a troop-specialist city benefits - a bit - from a library or marketplace. So if it's a choice between nothing or those, build those. Or start a wonder that you can't finish anyway, for the money.
Finally, later in the game, you can obviously build wealth, science of culture. But I assume you're talking about early game when those aren't avaible yet?
Anyway, there is a trick to forcing cities to idle. If you put on the 'minimize popups' option, the choice isn't forced on you until the very end of the turn. So you can end your turn before giving a city new orders. But really, there's not much point.