This
climate chart is a good resource for your questions.
My opinion is that May and October are good seasons for both very decent weather and to avoid crowds (and higher prices)
If you go for a beach destination my favourite portion of Andalucia is actually the one between Cadiz and Los Caños de Meca.
Weather and water are cooler than Malaga.
White sandy beaches, mostly empty at this time of the year, wonderful seafood and fish.
I suggest Conil de la frontera as a base for
exploring
GBM