Why is "two times" दो बार and not दो बारें, when बार is feminine?
बार is both a noun and an adverb, just like in English. It depends on the way it is used:
1. Noun: Here, it means 'time'.
E.g. "The first time" - "पहली बार" [And yes, it is a feminine noun]
2. Adverb: Here, one can say it means 'times'. Like other Hindi adverbs, it does not depend on a related noun's gender or number.
E.g. "Two times" - "दो बार", "One time" - "एक बार".
According to wiktionary (https://en.wiktionary.org/wiki/%E0%A4%AC%E0%A4%BE%E0%A4%B0) बारें does exist (see the declension). However, as an example they give दो बार, not दो बारें. Do you mean that in such expressions (one time, two times) बार is not really treated as a noun and shouldn't change according to the declension rules?