Any spacer over 20mm has built in studs so you don’t need longer studs. I would just get new rims, I’d never run a 40mm spacer, there’s a reason most companies only go up to 25mm.
And that article Sasha wrote seems to imply that a 17x7 -8 and 17x9 -8 will stick out the same, which is completly false.