I don't think there is a formula that will give us that +0.
The bat is a very weak creature, with a CR 0. Most likely, the D&D designers just didn't want him to have a negative attack modifier, so they set it at 0, despite having -4 STR and +2 DEX.
- If the attack was strength-based, the bat would need a +4 Proficiency (a bit high for a CR0 creature).
- If it were Dexterity-based, the bat would have -2 Proficiency (negative proficiency?).
It was a balance decision. The bat also does 1-damage with that attack, which is not derived from any formula. An unarmed strike is usually 1+STR, and a natural attack 1d4+STR, so both would deal non-positive damage.
From the DMG, on Creating Monsters (credit to Sdjz):
You can start with the monster's expected Challenge Rating table to determine an appropriate attack bonus for all the monster's attacks, regardless of its ability scores. [...] Feel free to adjust the attack bonus as you see fit to match whatever concept you have in mind.
Also, AFAIK, there aren't monsters with negative attack modifiers, are there?