[cleanup] Fixes several Clazy findings and nearby cleanup
If some commits require additional review, rework, or discussion, I remove them from this merge request and create separate ones.
If some commits require additional review, rework, or discussion, I remove them from this merge request and create separate ones.