Kdevelop has separate commands for commenting (ctrl+d) and uncommenting (ctrl+shift+d).
Is there a way of using a single shortcut to toggle both?
Yes. Use Settings->Configure Shortcuts and enter comment
in the search box.
You will see a line Toggle Comment, which you can assign a keyboard shortcut.
In this same list of results you'll see Comment and Uncomment which you may like to unassign bindings from.