What we usually do is take care of having a different configuration for Live vs Staging at the root source, i.e. have a build script (ANT or Maven) that takes different parameters for Prod Live and Prod Staging which yields different WAR files, one with XPM and one without.
If you are adamant on having one WAR file for both that only controls the inclusion of the filters, then customizations as you've suggested are the way to do it. There is no central switch out of the box provided by Tridion for this kind of thing.
However, in the Tridion CM, there is a setting that controls if a publication target has "Enable inline editing":
What this means is that the XPM Javascript won't have the necessary XPM settings to function fully. However, you will still need to add logic to your templates to not show the Page Settings script which shows the XPM toggle switch:
<!-- Page Settings: {"PageID":"tcm:10-14906-64","PageModified":"2014-11-02T22:11:45","PageTemplateID":"tcm:10-14703-128","PageTemplateModified":"2014-11-02T22:11:15"} -->
<script type="text/javascript" language="javascript" defer="defer" src="http://localhost:81//WebUI/Editors/SiteEdit/Views/Bootstrap/Bootstrap.aspx?mode=js" id="tridion.siteedit"></script>
This script is either rendered using the out of the box TBBs for a Dreamweaver-based templating solution, or manually via other custom means.
You can determine this in your templates with a TBB function as described here: How to determine if publishing to SiteEditable/XPM-enabled site?