Is there a way to disable image attachment links trought a filter in functions.php or something ? I know it's possible to do it manually when you add an image to a post but I want to disable this functionality by default.

UPDATE

What I want to do is set the "Link URL" option to "none" and remove / hide it from the upload attachement screen.

There is a plugin to solve this called "Remove Link URL" and it removes the link by default, still allowing it to be added in if you click the button. I believe this fixes the problem you're describing :)

I use a custom theme which doesn't have loop-attachment.php in it.
–
inwpitrustMay 28 '11 at 10:31

ok. that complicates things. if you want to go down this route I would suggest you look in the main loop of the twenty-ten theme and see where the loop-attachment.php fits in, and try and import it over. Otherwise you could look for instances of wp_get_attachment_metadata() in your theme to see where your theme is attaching the image links.
–
edzillionMay 28 '11 at 11:56