I want to remove last item from product collection
$collection = Mage::getModel('catalog/product')->getCollection();
But I have to avoid any 'loop' solutions.
Without context, I cannot say if this is a good idea, but if you have a loaded collection and want to remove the last item from the collection (not delete it), you can do this:
$lastId = $collection->getLastItem()->getId();
$collection->removeItemByKey($lastId);
This works because internally the items are stored in an array with their id as key.
Additional database query but retaining collection:
$collection = Mage::getModel('catalog/product')->getCollection();
$collectionSize = $collection->getSize();
$collection->getSelect()->limit(--$collectionSize);
Basic PHP but out of collection scope:
$collection = Mage::getModel('catalog/product')->getCollection();
$products = $collection->getItems();
array_pop($products);