When strip-flags (from flag-o-matic.eclass) is invoked in a non ~arch system, it removes optimization flags as -Os and -O3. Since -O2 is a safe flag, if an optimization flag was present in CFLAGS and no one survived the stripping, i think it is reasonable to reintroduce -O2. The following patch to flag-o-matic.eclass does that.
Created attachment 20340 [details, diff] flag-o-matic.eclass.diff patch for /usr/portage/eclass/flag-o-matic.eclass (consider also modifying /usr/lib/portage/bin/extra_functions.sh)
Done, thanks.