In particular, I want to know the penalty (if any) for teaching scripture to Mlecchas.
Does Manusmriti (or similar works) prescribe punishments for Brahmins who propagate scripture to the undeserving?
The following verse says that the sin a Brahmin commits by teaching someone who is undeserved is removed by Japa (reciting sacred texts) and Homa (burnt offerings).
Manu Smriti 10.111. The guilt incurred by offering sacrifices for teaching (unworthy men) is removed by muttering (sacred texts) and by burnt offerings, but that incurred by accepting gifts (from them) by throwing (the gifts) away and by austerities.
Another verse which is giving a punishment for revealing the secret of Vedas to strangers or to persons who are unworthy to know such secrets.
11.197. He who has sacrificed for Vratyas, or has performed the obsequies of strangers, or a magic sacrifice (intended to destroy life) or an Ahina sacrifice, removes (his guilt) by three Krikkhra (penances)
11.198. A twice-born man who has cast off a suppliant for protection, or has (improperly) divulged the Veda, atones for his offence, if he subsists during a year on barley
2@SK Yes generally, because it depends on the crime and the caste concerned. On the other hand, a Brahmana who drinks liquor should atone for it by killing himself by drinking boiling liquor, whereas a Shudra does not sin by drinking liquor. Jan 29, 2019 at 17:23
3@SK "A twice-born person, having, through folly, drunk wine, shall drink wine red-hot; he becomes freed from his guilt, when his body has been completely burnt by it."—Manusmriti (11.90); on the section titled "Expiation of drinking liquor (sura)" Jan 29, 2019 at 17:57
2@SK wisdomlib.org/hinduism/book/… Jan 29, 2019 at 18:00
3@SK Gautama (23.1).—‘They shall pour hot wine into the mouth of a Brāhmaṇa who has drunk wine; he will be purified by death.’ Jan 29, 2019 at 18:01
3@SK "Wine indeed is the dirty refuse of grains, and sin also is called ‘dirt’; for this reason the Brāhmaṇa, the Kṣatriya and the Vaiśya shall not drink wine." Jan 29, 2019 at 18:06