You didn't test the original query, which would be
select * from test_index_usage where object_name = nvl(:x,object_name);.
However, it turns out that Oracle 11 is much smarter than I thought:
So yes, your approach was right, at least in Oracle 11. I know Tom Kyte suggested a different approach in one quite old discussion, so I'd say previous versions of Oracle were not that smart.
Edit: if the goal was database agnostic code, I'd still use the build-the-correct-statement approach.
Edit2: thanks for actually doing the test

- I should have it done myself.