Fix arg count for partial functions
# What does this PR do?

As pointed out in #12605, the count for the number of arguments in the `model_init` was not working for partial functions. This PR fixes that.