This method is quite advanced and not really for new players, but if you have the means its one of the fastest ones in my opinion. Also i just doesnt want to basically copypaste the answers above so i'll propose different methods.
Get affinity boost or/and affinity blessing from MR30 players on relays, get smeeta kavat with charm, get naramon.
One great thing about this method is that you don't depend on other players and you can do this any time solo.
Use Night Equinox in a Grineer Exterminate mission (preferably on Sedna, but it can be whatever you want).
Make sure you have enough energy (use energize, high efficiency or energy pads).
Put enemies to sleep and kill them or use finishers. Make sure your weapon can kill them with one shot, if not then use finishers. Try to put everyone to sleep before attacking.
The affinity booster will stack with affinity blessing with naramon passive with potential smeeta charm and 500% bonus of stealth kills resulting in 5k-10k~ affinity for a simple lancer. If you play it well and dont cause any alarms you should easily go from 0-30 in 1 mission. This also greately helps with focus farming, so make sure your Equinox is wearing a lens of some kind.
Being a high MR helps here because your starting mod capacity depends on MR, which helps in modding your weapon when you just start leveling it up.
If loud primary/secondary:
Before Deimos this method worked only with melees but with helminth you can level up loud primaries and secondaries in that way too. ( you could use a hush type mod too, but some weapontypes (like shotguns) just dont have it)
Subsume Equinox, Get Banshee, Put Equinox's skill into Banshee. Why Banshee? Banshee has a special passive, she makes all your weapons quiet.
Do the exact same thing as with melees, but this time you can change up Naramon for Zenurik for better energy economy. 0-30 in one ~5minute mission basically guaranteed. Great for leveling Tenet weapons.
Get Gauss, Subsume Gauss. Put Gauss' skill in warframe of your choosing. Mod for efficiency and range, ignore duration. Get into Sanctuary or Hydron or something similar. Spam Thermal Sunder. 100% affinity goes to warframe. Thermal Sunder will easily kill enemies up to 40-50 level, after that it gets tricky. Easy to level up warframes which have little to none offensive skills and depend on weapons or other players to level up.