Static initializers don't work in the end, because there's no way to specify ordering dependences. The code is slowly amassing a hodgepodge of alternatives, including singleton objects initialized at first access, using a hand-written double-check locking pattern.
A better solution would be to allow programmers to declare "init functions" for modules, and to list their dependencies in their declaration. Then, at the top of main(), mongo programs would call InitMongo(), which would execute the init functions in top-sort order.
Implementations I've used in the past have declared init functions using a macro:
Further, you can declare nodes in the dependency graph to aggregate things. For example, if you need to run some code after all global foo objects are initialized, you can have a macro for declaring global foo objects that makes their initialization code out-depend on "foos_initialized", a noop node. Then, your code that depends on "all foos are initialized" can just have an input dependency on "foos_initialized", and doesn't need to explicitly be able to name all instances of "foo".