Yes you can exclude certain bones from getting weighted to the mesh. I often refer to these as “utility bones” or “mechanism bones”. To exclude them from being automatically weighted to the mesh, simply uncheck “Deform” in the bone properties for the bones you want excluded before parenting mesh to armature. You can uncheck Deform for all selected bones by holding ALT and unchecking.
I do this selective deformation process in this lesson of the Piero short film course.