The .380 is bare minimum.
The 9x18 Makarov is low-adequate.
I feel the 9 is adequate with extra adequate ammo.
The .45 is great, but not enough ammo.
The .40 is the perfect mix in effective AND ammo capacity. Speed of the bullet, bullet weight, capacity, cost, and availability all influence my decision, but EFFECTIVENESS is the most important.
Here's a picture of my shooting an old steel water heater at 50 feet with 9mm and .40 caliber. The dents are the 9mm. The holes are the .40. Using similar factory ammo.
I've been through many shooting schools. When I was at Gryphon Group, we were issued the .40 because the 9 would not reliably penetrate windshields because it was too light, and the .45 was too slow to penetrate windshields consistently. Issues with the 9 and .45 penetrating AND remaining on target. The .40 was the ideal speed and weight to consistently punch through AND remain on target. That's me in the drivers seat in the picture. Training operation was shooting at targets through windshields and through side and rear windows.
While not scientific, it does make me want to carry the .40 over the 9mm. It demonstrates the deeper penetration through hard targets - breaking bones like ribs and femurs, penetrating car doors, wood desks, windshields, or wood studs that you may need to shoot through in self defense. Since most of us spend a lot of time driving, being able to shoot in self defense through a windshield or car doors etc. is important to me.
(Ignore the 5.56 holes).
Edited to add: I've at times carried the .380, 9mm, .40, and .45, and have examples of all of the above calibers. I would feel protected with any of them in standard day-to-day situations. For instance, when I go jogging in rural areas, the biggest threat is stray aggressive dogs, so I carry a compact glock with 9mm hollowpoints. I feel capacity for followup shots in the most important to ensure scoring a hit. (Note I also have pepper spray for dogs). However, I typically prefer the .40, but not always. Variety is the spice of life!