Not a malware developer but here's what I suspect to be the case and what I've heard in other seminars.
First of all, there are a lot of kits available on the dark web where you can purchase malware and malware development kits as a service. Someone already built the components; now just assemble the components and let loose!
Keep in mind that organized cybercrime makes a lot of money. It's out of kids' hands and in the hands of true professionals. Given that, I'd suspect that they have labs, etc, where they can test and develop. Most large security companies talk about there being, for lack of a better term, professional malware enterprises that do their work in office buildings.
Even if it's someone working in a basement somewhere, these people are criminals. Theft of resources isn't a huge problem for them. Maybe they steal hardware. Maybe they steal compute capacity from unsuspecting victims. If it were me, I'd have copies of VMWare and build and test on virtual machines. Those can be reset back to an original configuration quite easily.
Keep in mind what malware is now. It used to be centered on destruction. Now it's centered on financial gain, exfiltrating data to a known host somewhere else on the internet. So the risks to the developer, although high, aren't the loss of their hardware any more. The developers also most likely know how to prevent any of their data from exfiltrating - were I to do that, I'd make sure that I knew how to close that particular door.