You can use tape or heat-shrink to re-identify a wire if its 4 AWG or greater or if it's part of a multiconductor cable (which NM-B is).
The reason for the 4 AWG rule is probably an economic one. Having spools of larger conductor cables in a variety of colors is not inexpensive. Allowing the reidentification seems reasonable, though I'd probably argue the cutoff could be thinner than 4. The multi-conductor cable exception is a practical [and economic] one. You might not be able to get multi-conductor cable assemblies with the exact color coding you need.