I don't see a way to hide it in the API based on a quick look, although I didn't do an exhaustive search.
You can display it with the following macro, which pins and then unpins it.
.TaskPaneIsPinned = True
.TaskPaneIsPinned = False
This will work if there are no other solutions.
The reason i want the expand/restore button is i would like it to stay pinned at all times so i can still view it in a narrow state and then toggle the size of the pane with the press of the shortcut key when i need to access items in the task pane.