Hand-coding multiple versions of a function or class to accommodate various types would be just as bad in terms of code size, no? Plus it'd be tedious and error-prone to do this.
Just like everything else, it's a time/space tradeoff because it generates less optimal code in exchange for a smaller binary size.