Refactor default-compiler-flags.py to reduce duplication Change-Id: I059d4857ea6744ac791592c50d41a6ef8b8d60cc