A thermonuclear supernova interacting with hydrogen- and helium-deficient circumstellar material