We don't know the internal structure of \C. I was about to write more or less the same answer, but would favour using a \toks or \unexpanded in the \edef case for this reason.
–
Joseph Wright♦Aug 16 '12 at 7:49

And there is \protected@edef if LaTeX's \protect mechanisms should be supported.
–
Heiko OberdiekAug 16 '12 at 7:55

The first variant works perfectly. I should have specified that \C should be fully expanded, which is how it works. Thanks a lot! (Damn, I have to remember that trick with \noexpand.)
–
yo'Aug 16 '12 at 7:55

@JosephWright: There are lots of possible variants but the first step is to understand and decide about the expansion level. So I did not try to suppress full expansion in the first case.
–
Ulrike FischerAug 16 '12 at 7:58

@HeikoOberdiek If you do a single expansion level using a \toks or \unexpanded then \protected@edef should not be needed.
–
Joseph Wright♦Aug 16 '12 at 8:14

(We are not told anything about \B, so I've assuming it might be expandable.) I have assumed \C is a variable, and have deliberately only expanded it to it's value: you could miss out the \exp_not:V and have x-type expansion.