The best temperature for solar panels to output the most amount of energy can be figured out by looking at your datasheet.
The ideal testing conditions of STC (Standard Test Conditions) are done at 25°C (77°F), so you could say that is the peak best temperature, and any higher causes energy loss.
If you look on your datasheet you will find the NOCT rating. For example the Peimar 300W all black panels have a Pmax Temperature Coefficient of -0.42% / °C, meaning for every 1°C that they go above the STC temperature of 25°C, the panels lose 0.42% in energy.
Lost energy % = 1 x -0.42 = -0.42%
(100% - 0.42%) x 300W = 99.58% x 300W = 298.74W
Even though your solar panels will underperform if their temperature is above 25°C, they will still operate and produce energy. The other number on the datasheet that you’ll want to review is the Operating Temperature, which for the Peimar 300W all black panels is a range of -40°C ~ +85°C.