I enjoy architecture a lot but was bored by the Palacio Real. I assume that a more knowledgeable traveler would have appreciated it more.
I think you need to work up a list of the places you want to go before deciding on a suitable base. I'm not sure there's anywhere that will work as well as Madrid itself. It's sort of in the center of Segovia, Salamanca, Toledo, Cuenca, and Alcala de Henares. (I haven't been to El Escorial and just can't bring myself to list Avila with all those other places I like so much more.)
I think Salamanca is way too far from Madrid (I believe over 2 hours by train) to be practical for hitting the usual places people want to visit from Madrid. In most cases you'd first have to travel all the way to Madrid, then hang around for the next outbound train to your ultimate destination, amounting probably to 6 to 8 hours of travel time, round-trip.
However, Salamanca might work (I haven't checked bus and trains schedules) for seeing Ciudad Rodrigo (interesting walled town) and Zamora. Salamanca itself has a large enough historic area to justify (in my view) a two-night stay, so you might think about splitting your nights between Salamanca and Madrid.
Toledo is worth an overnight or two for anyone interested in architecture. I loved the Mudejar spots. I'd just find it annoying as a base for other side-trips, since you always have to head back to Madrid first.
A day-trip will be sufficient for Cuenca since you have no interest in its art museums; buy AVE tickets early to make it affordable and practical.
Alcala de Henares is an historic university town with a very pretty historic area. It's easily accessible from Madrid via a commuter train that runs frequently even on Sundays.
If you run out of side-trips before the end of the week you can consider Chinchon, a bus ride from Madrid. It's a comparatively minor destination but interesting.
Edited to add: Having spent some time in the area around Madrid and in Extremadura in late May and early June, the heat of July would concern me. You've only got a week, so you should be able to gut it out, but if you end up with more potential destinations that you have time for, you can use altitude as a tie-breaker; perhaps that will help a bit.