I did not mean to imply the trip was not possible. You just need to plan accordingly. Driving will add considerable time and aggravation to the trip. In addition to the winding and slow roads, you will often be stuck behind busses and trucks that will slow down the entire process as places to pass are not always available even on roads like the Panamericana.
Regarding public transport, I have seen scheduled bus service in some of the most remote parts of the high country. Bus travel is a lifeline to the outside world for many small towns and villages in Peru.
Regarding safety, you need to carefully check conditions in various areas. Even places that have hard surfaced roads pass through areas that require care. I have been stopped and detained by the Policia at various roadblocks over the years for no other reason that I was a gringo. Peruvians were allowed to pass, as was I (eventually) after paying the required "fees." I have friends who have been held at gun point for hours at make shift road blocks (remnants of the Sendero who are now just thugs) in areas thought to be relatively safe. You just need to plan carefully and things should go well.
If you do end up driving, I really doubt that the itinerary you have laid out is possible in anything under 15 days. Even that would be a stretch if you wanted to spend any time at all in any of the places you mention. Also realize that for a large part of the year fog is a huge problem along the Panamerica between Arequipa-Nazca-Lima making the trip extremely slow - you can creep along at 10-20 kmp for hours at a time.