If I’m not wrong from a python perspective you don’t need to return it but I would consider it a good practice.
If you call train(model,data) what do you loose for doing model=train(model,data). It’s more clean, more concise and more readable. You neither need to pass model to the function as it is an outer variable but you still pass it. Furthermore that behavior depends on which object are you passing to the function, if you pass an integer it would behave the other way around.