"If it's too loud in the Beis Medrash, bedieved you can learn in the Ezras Nashim." (Weiser)
"If you know that something is kosher only b'dieved and you can buy something else l'chatchila, or course you should buy the l'chatchila item." (source)