Special:NewItem and Special:NewProperty allow creation of items and properties with a term language not contained within the allowed list. For example "TEST".
Some level of validity check still occurs throwing out codes with bad characters T138724
This is likely very similar to T39459 although that task talks about using uselang with an invalid code (which is different but related to this case) and also T39459 doesn't actually allow you to make the add as far as I can tell.
See for example my test @ https://test.wikidata.org/w/api.php?action=wbgetentities&ids=Q2528