detect pin mode possible?

For example, what if I don't want to initialize the pins to some arbitrary state at setup?

Pins are always set to some mode. They default to INPUT unless YOU define otherwise.

What if I want to just leave them as they happened to be at a given moment.

Then, don't do anything. They still have a known state when setup() gets called.