Would this be acceptable: "Matej must not eat pears."? It seems the meaning is that he is allergic or sensitive in some ways to pears, which can be conveyed by either "He cannot have pears" or "He must not eat pears".
We do accept such a translation as well, though it is not unusual to just say MUST NOT without indication of what the person must not do with it as it is typically understood.
Would you say like that in formal speech or is it rather colloquial? Is it common or limited to some simple contexts, like eating? (I guess also "Matěj nesmí domů" might work, so 'going' would also be covered).