How to counter bitterness in dal recipe
In dal recipes I have made, the lentils and tempering are cooked separately, then combined later.  They generally begin by toasting spices (careful, mustard pops, but that is what you want), then caramelizing thinly sliced onion in the spices.  This brings out the sweetness of the onion, which can offset the bitterness of some of the spices.  Once the lentils are cooked, the tempering (onion and spices) is added and the seasoning is adjusted.