It seems that the command mbed toolchain GCC_ARM modifies (updates the change timestamp) the configuration file (.mbed) even if the value does not change. This can be a problem at least in mbed-os-5 because modifying the file .mbed forces a full recompilation.
Probably first reading the configuration and only updating the file when something actually changed would be a superior behaviour.
Related source: