It seems that
clip currentpicture to p;
not only clips the picture to p, but also sets its the bounds in an unpredictable way.
Here is a MWE:
filenametemplate "%j-%1c.png";
outputformat := "png";
beginfig(1);
save u;
u:=1cm;
draw (-1,-1)*u--(-10,10)*u--(10,10)*u--cycle withcolor (87, 1mm, -.5bp);
clip currentpicture to (-10,-10)*u--(-10,0)*u--(10,0)*u--(10,-10)*u--cycle;
endfig;
end
The produced picture has wide empty space on its right and left, (the vertical size is as expected):

withcolorappears to be left over from one used with thehatchingpackage.bboxof thecurrentpictureand the path that you have given. What else where you expecting? That it would automatically shrink the bbox after it has done theclip?