This is a myth! It’s a tradition but not halacha, so you don’t have to feel like you’re not completing the mitzvos of Purim. That being said, if you want to have hamantaschen, do so! It’s not like most holidays where you have them throughout the year. Enjoy one this Purim holiday and know that you’ve kept to tradition along with your healthy habits.
1 hamantaschen counts as a treat.