Of course users can still upload files and post comments to the
respective urls directly, even with 'showattachments' or 'showcomments'
set to 'no'. These settings just tell the skin not to render the HTML,
they don't affect any privileges.
If you want to prohibit commenting, set the according rights (Level
'comment') for the page/space. Unfortunately there is no rights level
for attachments. Attachments are (hard-coded into XWiki's Core) bound to
the 'edit' rights level.