You could have an actual expansion tank. These are normally installed in the cold water line near the water heater. They are generally installed to account for expansion of the water as the heater raises the temp (the water expands). If you have a closed system (i.e., either a check valve or prv) in the house, they are required. The water in it genrally isn't stagnent, as long as the bladder is intact. Old-school thoughts to water hammer had a stub of pipe rise before the fitting to the valve. The theory was that they would hold air, and allow the moving stream of water a place to go when you shut off the valve, preventing hammering of the water column against the now closed port. Those never worked for long, as the air got absorbed in the water and they ended up full. Trying to empty them by turning off the water and draining the lines was akin to holding your finger over the end of a straw...it just plain doesn't work. So, once full, they stayed that way. Thus, the advent of engineered arrestors. Keep in mind that you normally only need a hammer arrestor for quick acting valves like on the washing machine, ice makers, and dishwashers. A typical valve doesn't require one. If the pipes are well supported, even if you have a water hammer, it may not move the pipes enough to bang into something whereas you'd hear it. It can take its toll on internal bits, like washing machine hoses, toilet filler hoses, and sink faucet supply lines, (since those are the most flexible and likely to move), but you may never notice.
Some flexible water heater supply pipes could have some rubber in them that creates the problem, but you'd normally see it at all hot outlets, not just one.
None of this answered your question, sorry, but might have given you some background info. You could probably pay a lab to determine if the black stuff was organic (growing) or some breakdown product from a component.