On second thoughts why not use a flag (as checking for one key (cf_profile) then using another (cf_patch) in later code is a little confusing). e.g.
```python
if 'cf_profile' in iris.site_configuration:
    enforce_cf_profile = True
else:
    enforce_cf_profile = False
```
or similar. Then everything below becomes ```if enforce_cf_profile: ...```. This also neatly avoids modifying ```site_configuration``` unnecessarily.