I have been recommended automotive water pump grease as it is designed to work in water above boiling point.
The Royal Navy painted their barrels in the days of pinned barrels with a black japanning gloss finish. I quote from the Encyclopaedia Britannica (1911)
'The varnish for black japan consists essentially of pure natural asphaltum with a proportion of gum animé* dissolved in linseed oil and thinned with turpentine. In thin layers such a japan has a rich dark brown colour; it only shows a brilliant black in thicker coatings. For fine work, which has to be smoothed and polished, several coats of black are applied in succession, each being separately dried in the stove at a heat which may rise to about 300° F. Body colours consist of a basis of transparent varnish mixed with the special mineral paints of the desired colours or with bronze powders. The transparent varnish used by japanners is a copal varnish which contains less drying oil and more turpentine than is contained in ordinary painters’ oil varnish. Japanning produces a brilliant polished surface which is much more durable and less easily affected by heat, moisture or other influences than any ordinary painted and varnished work. It may be regarded as a process intermediate between ordinary painting and enamelling.'
* GUM ANIME, Gummi anime. From Hymenaea courbaril: used to make spirit varnish; soluble in alcohol. Gum cancame and Jamaica-birch rosin are sold for it. Actually most natural rosins will suffice. Essentially it is a species of thinned real yacht varnish applied thinly with black pigments and dried under heat.
Bootnecks (apologies, Royal Marines) had no ship to manage so they kept their muskets bright but the mateleots had better things to do so theirs were painted to preserve against rust at sea.