Is it possible to programmatically mute the iPhone?
No.
Applications developed using the official SDK cannot change (and in most cases cannot even access) system-wide settings.
It is possible, but only using private API's. I only went as far as muting the ringer, but you should be able to control the master level as well.
See How to disable iOS System Sounds
It is technically possible to change the system volume through the private AVSystemController
class in Celestial.framework, but will prevent your app from getting Apple's approval