That depends on how you pick the gravitational constant. It's trivial to make e show up in gravitational equations but with the right g you can avoid pi in a our world. At which point you can play around with a different number of dimensions, but that's just math and has nothing to do with physics.
If you then add another dimension (a flat world of two spatial dimensions), you suddenly get a 1/r relation for the force (log(r) for the potential) as the gravitational flux can now disperse in two dimensions. Naturally, a constant comes in here, which is a function of π. The argument naturally extends to three dimensions to give you 1/r² and a more complicated coefficient.
Naturally, this also applies to other classical forces, viz. electromagnetism.