Nema 23 Boss is 38mm-/+0.1 the whole point of the boss is to have close fit to stop movement so making 40mm hole is wrong way to go aout it. 38.3mm usually is just enough for nice snug fit. When done this way then there's no problem with slots or mounting holes if again they are milled to correct size also.!

IF you don't have room for slot adjustment then use an idler gear to take tension up. Not ideal way to do it but will get the job done.