The main reason for fabric gun port patches was to prevent 'damp cold' - moisture freezing, at altitude, in the barrels and working parts - and the ingress of dirt and dust.
Depending on the aircraft type, 'blast tubes' were part of the actual mounting of the weapon, intended to hold and align, whilst absorbing at least part of the blast/recoil effect. Muzzles exposed beyond the wing were covered in cardboard or 'plastic-type' caps, or sometimes fabric, for the same reasons as above.