The northern California places are all pretty well trodden paths and may have areas that are pricey to stay in. This is where we really get your money.
Starting at the south end, in San Luis Obispo, avoid motels on main drag.
In the Monterey Peninsula, next county north, you can find reasonable lodging in Marina/Seaside. Salinas is historic and they have the Steinbeck Museum but avoid main streets there, too for lodging. In the southern end of Monterey County on the coast, Big Sur, expect to find expensive lodging if you go up the coast from San Luis Obispo.
Going further north, Santa Cruz and Capitola are great places and is worth comparing motel prices first.
San Jose area, near Cupertino, is nice and smaller motels are reasonable and large high rise hotels are very expensive.
Then proceeding further north, San Francisco's Lombard street has some great deals on lodging in smaller places if you make it to the city.
North of San Francisco is where the prices come down again beyond Marin County (Sausalito, San Rafael).
Santa Rosa is the biggest city in wine country in one of the main wine regions of Sonoma County. Sacramento to the east is the state capital and there are some high priced downtown places that catch unwary tourists.
Beyond that, going further north, don't worry about lodging costs so much. There are a lot of hidden gems of cities in the far north in and beyond wine country on the coast.
As for safety, when in San Jose, stay away from numbered streets in downtown; Mission/Hunter's Point/Tenderloin while in SF; and parts of Oakland. If near Oakland, Berkeley is a fun place to visit and Telegraph Avenue is always fun.
Remember California is a very long state and it takes longer to get around in the northern half than the southern half even though the southern half is far more congested. The southern half, or southern California, is really just less than the southern 1/3 of the state and where most of its residents live. Some of the roads in the far north in California are not up to par with the superhighways of southern California.
I hope this helps.