You are confusing photons with electromagnetic waves, light.
They slow down to 225,000,000 m/s in water with a refractive idex of 1.3, to 200,000,000 m/s in glass and to 125,000,000 m/s in diamond. So its speed can be varied with variations in the medium.
This is not correct . Light,the electromagnetic wave, slows down. Light is made out by the superposition of a large number of photons, but photons are not light. They are elementary particles with mass zero and will always , when they exists, move with the speed c of light in vacuum, even within matter.
See this simple experiment

Single-photon camera recording of photons from a double slit illuminated by very weak laser light. Left to right: single frame, superposition of 200, 1’000, and 500’000 frames.
to understand how photon wave functions interfere and show the interference fringes expected by light, even though the individual footprint is a dot in (x,y,z,t). The wave nature of photons is a probability wave, it needs an accumulation of photons to appear.
In a medium individual photons will interact randomly at random angles, always at the speed of light ( more complicated than hitting the screen in the link) they will take complicated paths . If the medium is transparent and the classical light does not change color, it means they will make a large number of elastic collisions which extend the path length traveled by individual photons and will be seen as the slowing of the electromagnetic wave, light.