Gravity doesn't affect light speed. It affects space. No matter where you are and how strong gravity is, you would always measure the same light speed. In a black hole space is warped in such a way that light cannot escape, but the light speed is constant.
The observation that light speed is constant is only really true in vacuum. "Light" in a medium does not travel at the same speed, but in medium "light" is only approximately, but not exactly light. It is a combination of a traveling electromagnetic wave (light) and a traveling wave of atomic excitations.
That's not true. There are a lot of potential factors that can affect light speed in any medium other than vacuum.