The answer may surprise you. To get from the core to the outer part of the sun, it would take thousands of years as it has things like protons and electrons in the way. A single photon has to find a path whilst constantly being absorbed and re-emitted into random directions. The photon is bound to hit another particle after just 1 centimeter. Despite the speed of a photon it would still take thousands of years as there are so many particles in the way and the re-emmision happens in random directions