But according to this in a DC circuit there should be no potential
drop across the inductor(because di/dt would be 0)
Correct, the voltages and currents in a DC circuit are constant (by definition) thus, inductors in a DC circuit have zero volts across.
Were we only considering the instantaneous moment after the switch was
pressed for the derivation of the function?
A circuit with DC sources and a switch is not a DC circuit. When the switch opens or closes, the circuit is changed from the circuit (A) that existed before the switch changed state to the circuit (B) after the switch changed state.
There is then a transient during which the circuit (typically) transitions from the DC steady state solution for circuit A to the DC steady state solution for circuit B (if one exists).
Mathematically, the DC steady state solution for circuit B is approached asymptotically $(t \rightarrow\infty)$ but practically, the time for the transient to decay is finite. That is, after some finite time, the voltage across any inductor in the circuit is effectively zero.
Indeed, one finds the asymptotic DC solution by solving the circuit that is left after replacing all inductors with (ideal) wires and all capacitors with (ideal) open circuits.