The sun produces a mind boggling amount of power.
How much? The short answer to this question is that there is 5 million tons of matter being turned to energy every second in the sun. This happens from nuclear fusion, not antimatter annihilation or black hole energy conversion, so what that really means is that 700 million tons of hydrogen gets fused into 695 million tons of helium plus 5 million tons of energy.
You might be saying to yourself; hold on, 5 million tons of energy? Does energy have mass? Well, by the relativistic definition of mass -- E=mc2 -- it actually technically does. In this case, each kilogram is 90 quadrillion joules or petajoules, and every ton is 1000 times that or we might say 90 exajoules.
The world uses around 500 exajoules in a given year, which translates to about 6 tons of solid energy -- so think about it this way. If you took the solar output from the sun in 1 second, you'd get 5 million tons worth. The world uses about 6 tons worth over the course of an entire year.
So if you were to put up enough solar panels to capture about a millionth of the sun's output, one second's worth could power the whole world for a year.
Surrounding the whole sun with solar panels would be an incredibly large scale endeavor. It would be considered a type of Dyson Sphere (or Dyson Swarm as they are sometimes called). But it's surprisingly not that far out of reach. What you would want to do to start with is devise a type of self replicating robotic system that includes solar panels in the range of things it produces, and works using common raw materials such as asteroid regolith or rocks from a conveniently located low-gravity planet, like Mercury.
Exponential growth happens astoundingly fast.
Suppose you were to start with a 1 square meter area, and program the robots to double that area just once per year. If you put these collectors near Mercury orbit at 0.3 astronomical units from the Sun, the area to be populated would be about 275 square meters. That means that at the growth rate of 1.0 doubling per year, you would fill it in about 75 years.
That assumes a rather conservative doubling rate of 1.0 per year. Energetically speaking, it is possible for it to happen in one month or less. 75 months would be just under 6 years.