The question as asked is open to interpretation, so I will first rephrase it to have a basis to build upon. Your last paragraph tells me that you want to know the optimum bank angle to get the highest ratio of turn rate to altitude loss in a glide at a given airspeed.
Spoiler: Since steeper bank angles require more lift, and aircraft with better L/D are more efficient in producing lift, the optimum bank angle depends on the aerodynamic qualities of the aircraft.
What is given
- Glider or powered aircraft with inoperative engine. The polar and the weight are known and do not change over time.
- Airspeed. This will result in a restricted optimum - the absolute best bank angle will require a suitable speed.
What can be changed
- Bank angle $\varphi$ (obviously - you are asking for this)
- Lift $L$ (again, obviously. You want to stay airborne)
Solution
First I need to formulate the ratio of turn rate over height loss. This then needs to be derived with respect to the bank angle and set to zero. To have a derivable polar, I use the quadratic polar where $c_D = c_{D0}\cdot\frac{c_L^2}{\pi\cdot AR\cdot\epsilon}$.
I further assume a coordinated turn, so we can define the lift and drag equations. Drag is compensated by selecting a suitable glide path angle $\gamma$ in order to convert potential into kinetic energy to keep the speed constant. The angular velocity $\Omega$ in a turn with the radius $R$ is
$$\Omega = \frac{v}{R} = \frac{g\cdot tan\varphi}{v} = \frac{g\cdot \sqrt{n_z^2-1}}{v}$$
Height loss over time is vertical speed $v_z$, and this can be calculated from speed $v$ and flight path angle $\gamma$:
$$v_z = v\cdot sin\gamma$$
Since $v$ is given and constant, we can rephrase the problem as a maximization of turn rate over flight path angle or sink speed. This is equivalent to the smallest height loss for a given azimuth change.
$$\frac{\Omega}{v_z} = \frac{g\cdot tan\varphi}{sin\gamma}$$
Before deriving this, we need to express $\gamma$ in terms of $\varphi$. If we had the liberty to adjust speed, we could directly solve for the optimum bank angle at optimum L/D. Now, however, speed is fixed and L/D is what the airplane produces at the required lift. Since for gliders $sin\gamma = \frac{c_D}{c_L}$, we can write:
$$\frac{\Omega}{v_z} = \frac{g\cdot tan\varphi\cdot c_L}{c_{D0}+\frac{c_L^2}{\pi\cdot AR\cdot\epsilon}} = \frac{g\cdot sin\varphi\cdot \frac{m\cdot g}{q\cdot S}}{c_{D0}\cdot cos^2\varphi + \frac{\left(\frac{m\cdot g}{q\cdot S}\right)^2}{\pi\cdot AR\cdot\epsilon}}$$
with $c_L = \frac{m\cdot g}{q\cdot S\cdot cos\varphi}$. Since the dynamic pressure $q$ is constant, we can now derive with respect to the bank angle. With the chain rule we get a fraction, and since it will be set to zero, it is enough to look for the condition when the numerator is zero:
$$g\cdot cos\varphi\cdot \frac{m\cdot g}{q\cdot S}\cdot\left({c_{D0}\cdot cos^2\varphi + \frac{\left(\frac{m\cdot g}{q\cdot S}\right)^2}{\pi\cdot AR\cdot\epsilon}}\right) = g\cdot sin\varphi\cdot \frac{m\cdot g}{q\cdot S}\cdot 2\cdot c_{D0}\cdot sin\varphi\cdot cos\varphi$$
$$\frac{\left(\frac{m\cdot g}{q\cdot S}\right)^2}{c_{D0}\cdot\pi\cdot AR\cdot\epsilon} = 2\cdot sin^2\varphi - cos^2\varphi = \frac{1}{2} - \frac{3}{2}cos2\varphi$$
$$\varphi = \frac{1}{2}\cdot arccos\left(\frac{1}{3} - \frac{2\cdot\left(\frac{m\cdot g}{q\cdot S}\right)^2}{3\cdot c_{D0}\cdot\pi\cdot AR\cdot\epsilon}\right)$$
This does not obviously look wrong, but I could very well have screwed up on the path to the result. If you plug in the numbers for an airplane you know, you can check whether the result makes sense. At least, with too low airspeed you get a negative argument for the cosine which mathematically means a roll angle of >90° and can be interpreted as too slow for that turn.
EDIT
Now we got a similar question but with both speed and roll angle as variables. Obviously, now we need to derive both with respect to speed and roll angle. But it is more fun to plot the results over these two as a contour plot. I just had to do this since several answers here claim that the optimum angle is 45°. Equally obviously, this is too simplistic.
First the math: I start from the same equations as above and added a term for wind ($w_z$) which adds rising or sinking air mass to the problem.
$$∆h = \frac{\pi\cdot v}{g\cdot tan\phi}\cdot(v_z+w_z) = \frac{\pi\cdot v}{g\cdot\sqrt{n_z^2-1}}\cdot\left(\frac{v\cdot c_D}{c_L}+w_z\right)$$
Expressing the lift coefficient as $$c_L = \frac{2\cdot n_z\cdot m\cdot g}{\rho\cdot S\cdot v^2}$$
brings us to $$∆h = \frac{\pi}{g^2\cdot\sqrt{n_z^2-1}}\cdot \left(\frac{\rho\cdot S\cdot v^4\cdot c_{D0}}{2\cdot n_z\cdot m} + \frac{2\cdot n_z\cdot m\cdot g^2}{\pi\cdot\rho\cdot S\cdot AR\cdot\epsilon} + w_z\cdot v\cdot g\right)$$
Nomenclature:
$\kern4mm g\kern6mm$gravitational acceleration
$\kern4mm n_z\kern4mm$vertical load factor
$\kern4mm \rho\kern6mm$air density
$\kern4mm S\kern5mm$wing area
$\kern4mm v\kern6mm$flight speed
$\kern4mm c_{D0}\kern2mm$zero-lift drag coefficient
$\kern4mm m\kern5mm$aircraft mass
$\kern4mm AR\kern1mm$wing aspect ratio
$\kern4mm \epsilon\kern6mm$Oswald factor
The figure below is the result plotted in R. Since I need to read the full matrix of values for the contour plot, the area of low speed and high bank angle is filled with the result of a strict penalty function, so please disregard the values to the right and below the red line.
Contour plot of height losses a A320 type aircraft in a 180° turn at sea level and MTOW (78 tons), no wind. X is bank angle in degrees and Y is flight speed in m/s. Own work.
As you can see, the minimum (approx. 170 m) is achieved right before stall at a high bank angle and speed. Unfortunately, you need the aerobatic version of the A320 to fly this safely.