In the Mars Helicopter Technology Demonstrator paper these are refered as "Chinese weights" and the purpose stated is
Chinese weights provide a restoring force on the blade moments when
under centrifugal loads thereby reducing the torque requirements on
the swashplate actuators.
Searching for the term leads mostly to RC sites, for example this explanation.
Being placed close to axis of rotation (and presumably heavy but small in volume) the aerodynamic effect should be minimal compared to the rest of blade.
My assumption is that this can be quite specific to Ingenuity (and RC models) because limited torque available in electrical actuator servos compared to control system of full-scale helicopter. (But it is my guess only.)
Edit: I have borrowed an image from https://mars.nasa.gov/resources/25043/mars-ingenuity-helicopter-3d-model/ (go there and rotate the model yourself to get a better idea how counterweights are placed) and tried to sketch how the force balance looks like:
Red arrows are centrifugal forces exerted on counterweight or blade's center of mass respectively. These forces are always perpendicular to the mast (rotational axis). Then, each of them can be broken into two orthogonal components -- parallel with blade pitch axis (green) and perpendicular to it (blue). Note that one blue arrow lays above pitch axis and second under, so they produce opposing torque and can cancel each other.