The "#" should be fine to make comments out of active HAL lines (you may have to comment out multiple lines),
_but_ i don't think the index lines are harmful in any way even if left in the HAL file since unless you enable
homing on index or use spindle synchronized motion, the joint.X.index-enable pins will never be set
true so the index logic is never enabled.