that 40° may have been a rogue measurement. I got it from the weatheronline site (in fact, they showed 41 as a max) but other places in the area were several degrees less. Still very warm though: Pamplona 34, Bordeaux 36, Biarritz 35; Sevilla 38 but you expect those kind of temps down there.
As for walking, you don't walk in those temps. You walk in the morning when it's cooler, and find somewhere shady to sit in the afternoon.
37.4° was the max yesterday in Bilbao according to the INM - not 40, but that is still hot. Pipped by Ourense at 37.9. 35 in Leon, Pamplona and Logrono; even Roncesvalles got up to 29.7, though Fisterra was only 17.4 - better head for the coast, Ivar, if it gets too warm in Santiago.