Split out of T9160 (PR #5374) at reviewer request (sever-sever): that PR bundled unrelated cleanup with the apply-path feature because it happened to touch the same files.
Fixes bare except:, extraneous f-string prefixes on ConfigError()/text calls without placeholders in src/conf_mode/firewall.py, the same except: pattern in src/op_mode/firewall.py, and 3 unused locals in smoketest/scripts/cli/test_firewall.py. No behavior change.