Different compilers have different granularity of library optimization.
eg. the # of APIs pulled in for a given type, like stirng, math, I/O, etc..
Additionally some API's have an interdepenancy on other parts of a
library, again compiler dependent.
So in short that could explain the seemingly large increase. You will
notice the same effect when you do floating point.
You might check your optimization settings to make sure you are at max,
if not debugging.
Usually something as complex as scanf needs some help from other libraries like stdio and string which will increase the amount of needed flash. The good news is that the next library as printf for instance will go with some lesser blowing-up the flash.
The experiences we all made are that at the beginning of a project the amount of flash used rapidly increases but the increase flattens soon, so do not worry right now.