DC motor speed vs PWM duty cycle
The plot you shared seems quite similar to the one using diode freewheeling shown here. As you are using a H-bridge with active freewheeling I would guess that could be related to falling and propagation delays on the MOSFETs; during transitions you gonna have a period when only the diode is freewheeling. Try adding a dead-time on your PWM generation, you can use TIMx_BDTR for that matter.

From 1 it also seems like lower gate currents tend to add non-linearity, so changing the gate resistors for lower ones might help.

But, as you said, the gearbox fluid would add non-linearity. Try driving the motor without the gear and checking the speed. If speed control is paramount open-loop control is discouraged. Speed feedback using a encoder and PID algorithm controlling the PWM would be good approach, as seem here.