Acronym, French. It means "Ta gueule c'est magique" ("shut up, it's magic"). This expression is used when for instance a scenario has a flaw needed for the story but that isn't realistic. If somebody asks how it's possible when it's obviously not, you answear that.
In Star Trek's DS9, season 3, episode "Explorers", Commander Sisko builds an ancient Bajoran Solar Ship from scratch without using any modern techniques. It looks like he built the things in 1 week - which is impossible. If one was to point that to you, you'd just say "TGCM".