San Pedro is also my home port, and we have done this itinerary at least 5 times. We have also done (and have one booked end of next month) the shorter 3 or 4 day trips. But, we don’t book a lot in the way of excursions. I did a very extensive review on our NCL trip back in 2016, which has a lot of port stuff if you feel like checking it out, link in my signature NCL Jewel Haven 2016 — just scroll past all the ship stuff. Be mindful that there has been an uptick recently of violence in these ports (Mexico generally, but lately even in Ensenada, Cabo, etc) — so pay attention to advisories, and don’t explore on your own anywhere that isn’t super touristy.
In Cabo, you will be bombarded by hawkers selling boat transport/tours, jewelry, “the best restaurant” etc. The further you walk from the ship, to your right and around the harbor, the better the pricing becomes. We had a great experience and pricing by walking about halfway around the harbor to the less frenzied tour people. (This is included in the review I mentioned along with Divorce Beach and the arches). We have a pretty casual routine with our friends at this point of just hitting Cabo Wabo (I like their shrimp tacos) right at opening, then a few specific shops as we walk back.
Mazatlan has the Blue Line from the port entrance that you can walk to take you to the center of the historic town (in review). At the end of the line, you will find a group of expats with maps and helpful info for you. The cathedral is lovely, as are some of the squares where you can have a nice meal outside with very festive atmosphere.
Puerto Vallarta I suggest the Malecon (in review 2016) via cab. We took the bus, but these days I would opt for the taxi instead. There is also usually an excursion to Las Caletas that we LOVE. It’s pricey but worth it. We’ve done it a couple of times now. The kids will love it, no beggars, tour operator is safety conscious and does a great job. Included food is very good, massage upgrade was awesome, but I did drink way too much tequila (open bar included). They have a website where you can get more info, just google las Caletas.