To answer the question of the legality of lane sharing in California, every other State EXCEPT California defines and limits how many vehicles can occupy the same lane space, generally one vehicle per lane. Some States give exemptions for motorcycles (e.g. allowing no more than two to ride abreast) and give exemptions for lane filtering, which is riding past stopped traffic at an intersection. Most States have specific exemptions for law enforcement motorcycles.
The CHP and DMV do post guidelines on lane sharing but they aren't regulatory. The California Vehicle Code does not address it. If an LEO thought that you were lane sharing unsafely, you would normally be cited for a CVC 22350 (violation of the basic speed law that says you cannot travel faster than conditions permit safely, regardless of the posted limit.) If you were lane sharing in a grossly unsafe manner, you would potentially be subject to an unsafe driving violation (covered in several CVC's.) You would of course still be subject to CVC 22349a (exceeding a posted maximum speed) like anyone else regardless of whether you were lane sharing or not.
The CVC has several unsafe passing provisions. Passing as defined by the CVC is an overtaking move effected by changing lanes. If you do not change lanes it isn't a pass by the CVC definition. Theoretically, if you zig zagged between lanes you could be subject to unsafe passing. In practice, unless you are clearly occupying an entire lane space when you pass, and you do it excessively, you aren't likely to be cited for that (there is California case law that sets precedent for allowing crossing of the lane marker while lane sharing.)
I personally think it's safer to lane share, in most instances, than it is to ride in the lane sandwiched by cars. I've nearly been rear ended on the freeway when there wasn't enough space to split and get out of the way. I also play by the rules in other States, since in addition to the legality consequences, drivers in other States don't expect lane sharing to occur. It generally is expected in California and I find that unless you ride like an asshole, most drivers are tolerant and let you by. There are always the occasional cock blockers that try to cut you off, but I find they are the exception and not the rule.
Talk to any CHP motor cop (I know several.) They expect motorcycles to lane share, and wonder why they don't when they see it. I have absolutely no qualms lane sharing behind a motor cop, or next to a CHP cruiser. If a motor cop is behind me, I'll normally get out of the way as a courtesy, and they usually wave in appreciation when I move over.