Is this possible? For all objects. And I do not mean the center of object …

No, there’s no trivial solution for this problem. The exact shortest distance for two 3d objects is either a vertex-vertex, a vertex-edge, an edge-edge or a vertex triangle distance. For 2d it’s either vertex-vertex or vertex-edge. Since “non-convex” could mean pretty much anything you can’t even do some logical reduction of the number of vertices / edges / triangles you have to check.

We can’t you help any further with that amount of details. If you want more help you should vastly improve your question and add more information.

- First of all do we talk about 2d or 3d?
- What kind of shapes do we talk about?
- For what purpose do you need this distance? Maybe an approximation is enough?
- How many objects do we talk about?