How to change the font of ticks and scientific notation to mathtext?

I have changed the font to “serif” via:

matplotlib.rcParams['font.family'] = "serif"

and change the mathtext font via:

matplotlib.rcParams["mathtext.fontset"] = "cm"

I realized the math format via"

plt.ticklabel_format(style="sci", scilimits=(0,0), useMathText=True)

But it cannot change the font.

How to change the font ticks and scientific notation to mathtext as simple as possible?

I know that plt.rc("text", usetex=True) can get it, however it will reduce the performance.
I need a general method to realize it.

My code:

import numpy as np
T = np.arange(0,1000,1)
k = 1.380649e-23
m = np.matrix([2,28,32])*1.67e-27
v = np.sqrt(3*k*T/m.T)

import matplotlib; import matplotlib.pyplot as plt
matplotlib.rcParams["font.family"] = "serif"
matplotlib.rcParams["mathtext.fontset"] = "cm"

plt.ticklabel_format(style="sci", scilimits=(0,0), useMathText=True)
plt.title("Kinetic Theory of Gases")
plt.xlabel(r"Temperature ($\rm{K}$)"); plt.ylabel(r"Melocule Velocity ($\rm{ms^{-1}}$)")
plt.plot(T,np.array(v[0,:].T),label="Hydrogen")
plt.plot(T,np.array(v[1,:].T),label="Nitrogen")
plt.plot(T,np.array(v[2,:].T),label="Oxygen")

plt.legend(loc="best")