At least where I live cast iron pipes are lined with epoxy coating. The content of the pipes is never in contact with cast iron directly except for the non-factory ends if they've not been painted after cutting.
Also, in my experience those consumer grade drain cleaners do nothing and there's no reason to for anyone to use them.