I have a motorcycle that calls for 10w30 oil, but all i can find at different stores around my house is 10w40 or 5w40 would either of those ruin anything if i use them instead?
The best practice is to follow your vehicle's factory specifications, those specifications are tested to bring out the best performance of the vehicle. This principle applies to both motorcycle and automobile industries.
If you want to learn more, checkout this video I found.
Neither of those will cause a problem, the 10W40 has a wider specification at the hotter end and the 5W40 exceeds the specification on both the hotter and colder performance.
The 5 in the 5W40 means that the oil keeps its viscosity rating at lower temperatures and will flow as it should when cold starting etc.
The 40 in 5W40 means that the oil keeps its viscosity rating at higher temperatures.
I had a Nissan TD23 in a Volvo 240 estate and the oil was specified as 15W40, but since we had added a turbo and changed the injector delivery I put a Mobil 5W50 oil in it and it was fine on that. expensive oil so I changed it at 20k but changed the oil filter every 5k - filters were dirt cheap... So, as long as the detailed specifications meet the manufacturer requirements, such as aceab1 or aceab3 or low ash c1 then you should be good to go. Don't take those ratings as relevant for your engine - they are for my engine and just as examples of more detailed ratings.