Solve Robot Paths using backtracking
There are a few things I would like to point out to you.

Style

Python has an official style guide called PEP8. Under "Indendation" there is the following rule most Python programmers stick to:


  Use 4 spaces per indentation level.


Reference: PEP8 - Indentation

This would also make your code consistent with the provided test code.

Though not strictly part of PEP8, most of the tools integrated in Python IDEs would also tell you that s is not a good variable name. Use something that is more descriptive (n_paths maybe?).

While we're at it, you can wrap long lines such as the sum of the four traverse calls on multiple lines to allow better readability in case you have, say two documents next to each other or a small screen. Including the previous note, s = ... could be transformed into, e.g.

n_paths = traverse(row, col + 1) \
    + traverse(row + 1, col) \
    + traverse(row - 1, col) \
    + traverse(row, col - 1)


The nonlocal keyword

I suspect you slightly missunderstood what nonlocal does. All variables from an outer scope are automatically available to read from in nested scopes. This means in your case, traverse can see num_of_rows and num_of_cols from robot_paths automatically.

Statements like nonlocal or global only come into play whenever you want to assign to a variable not in your local scope. The Python interpreter would then recognize, that you don't want to create a new local variable with the given name, but instead use an already existing one from an outer scope. This SO answer has a nice example to show you that effect.